摘要: Looping over a range of numbersBad:for i in [0,1,2,3,4,5]: print i**2Good:for i in range(6): print i**2Looping over a collection:Bad:colors = [ ... 阅读全文
posted @ 2015-07-19 22:28 db2zos 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write a function to determine if it is a power of two.My initial code: 1 class Solution: 2 # @param {integer} n 3 # @return ... 阅读全文
posted @ 2015-07-19 15:28 db2zos 阅读(185) 评论(0) 推荐(0) 编辑