python
yourenhello
这个作者很懒,什么都没留下…
展开
-
note***
在Python中,变量总是指向对象的一个指针,而不是可改变的内存区域的标签:给一个变量赋予新的值,并不是替换了原始的变量,而是让这个变量去引用完全不同的变量。实际的效果就是对一个变量赋值,仅仅影响那个被赋值的变量。原创 2013-10-04 15:19:57 · 470 阅读 · 0 评论 -
All In Row
There is a list that contains integers, list of integers or nested lists. Put all integer values into one list. Input data: A nested list or simple list. Output data: A one-dimensional list. Exampl原创 2013-11-16 17:09:47 · 440 阅读 · 0 评论 -
Prime and palindrome
An integer is said to be a palindrome if it is equal to its reverse in a string form. For example, 79197 and 324423 are palindromes. In this task you will be given an integer N. You must find the smal原创 2013-11-21 21:50:21 · 762 阅读 · 0 评论 -
走迷宫
Stephen and Sofia wander off for a moment, taking a break from the packing and piling and fixing of things on the ship. Randomly, they happen upon an Open Labyrinth they had never seen before on their原创 2013-11-10 21:34:15 · 710 阅读 · 0 评论 -
实现的任意下标开始的数组类
我们总是习惯 数组下标从零开始,为了改变一下习惯,我实现了一个任意下标开始的数组 class Array: #初始化 T(n)=O(n) def __init__(self,length=0,baseIndex=0): assert length>=0 self._data=[None for i in range(length)]原创 2013-11-10 15:22:04 · 697 阅读 · 0 评论 -
Python中下划线---完全解读
Python 用下划线作为变量前缀和后缀指定特殊变量 _xxx 不能用’from module import *’导入 __xxx__ 系统定义名字 __xxx 类中的私有变量名 核心风格:避免用下划线作为变量名的开始。 因为下划线对解释器有特殊的意义,而且是内建标识符所使用的符号,我们建议程序员避免用下划线作为变量名的开始。一般来讲,变量名_xxx被看作是“转载 2013-11-25 21:40:51 · 556 阅读 · 0 评论 -
Dot In Number
The previous version of robots wasn't able to recognize big numbers. Thus we should make big numbers more readable and place a dot every three digits from the end in the numbers longer or equal than 4原创 2013-11-13 20:06:59 · 486 阅读 · 0 评论 -
feed the pigeons
I start to feed one of the pigeons. A minute later two more fly by and a minute after that another 3. Then 4, and so on (Ex: 1+2+3+4+...). One portion of food lasts a pigeon for a minute, but in case原创 2014-06-26 16:49:35 · 698 阅读 · 0 评论