print 45678 + 0x12fd2
print "Learn Python in imooc"
print 100<99
print 0xff==255
print "Learn Python in imooc"
print 100<99
print 0xff==255
2020-07-25
def firstCharUpper(s):
return s[:1].upper()+s[1:]
print firstCharUpper('hello')
print firstCharUpper('sunday')
print firstCharUpper('september')
return s[:1].upper()+s[1:]
print firstCharUpper('hello')
print firstCharUpper('sunday')
print firstCharUpper('september')
2020-07-24
for x in [1,2,3,4,5,6,7,8,9 ]:
for y in [0,1,2,3,4,5,6,7,8,9]:
if(x<y):
print x*10+y
for y in [0,1,2,3,4,5,6,7,8,9]:
if(x<y):
print x*10+y
2020-07-21
s = 'Python was started in 1989 by \"Guido\".\nPython is free and easy to learn.'
print s
print s
2020-07-21
简单来说 and 左边为false,右边 不用判断就能得出结果为false;or左边为true时,右边不用判断就能得出结果为true。
另外两种情况可以自己思考,这就是所谓的短路原则
另外两种情况可以自己思考,这就是所谓的短路原则
2020-07-19
print [m*100+n*10+m for m in range(1,10) for n in range (0,10)]
print [L for L in range(100,1000) if L/100==L%10]
print [L for L in range(100,1000) if L/100==L%10]
2020-07-19
sum = 0
x = 0
while True:
if x > 99:
break
x = x + 1
if x%2==0:
continue
sum+=x
print sum
x = 0
while True:
if x > 99:
break
x = x + 1
if x%2==0:
continue
sum+=x
print sum
2020-07-15
sum = 0
x = 1
while x<=100:
if x%2!=0:
sum+=x
x=x+1
print sum
x = 1
while x<=100:
if x%2!=0:
sum+=x
x=x+1
print sum
2020-07-15
insert的插入,包括索引号和新元素。
索引号,表示集合中的某元素a。新元素的插入总是会插入在a的左边,所以顺序倒序都可以。
索引号,表示集合中的某元素a。新元素的插入总是会插入在a的左边,所以顺序倒序都可以。
2020-07-15