L = [95.5, 85, 59]
print L[0]
print L[1]
print L[2]
木有第四个 老师出错了吧
print L[0]
print L[1]
print L[2]
木有第四个 老师出错了吧
2015-10-02
# -*- coding: utf-8 -*-
print u'''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
print u'''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
2015-10-02
print 'Python was started in 1989 by \"Guido\." \nPython is free and easy to learn.'
2015-10-02
print [m*100+n*10+d for m in range(1,10) for n in range(0,10) for d in range(1,10) if m==d]
2015-10-02
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')
2015-10-02
L = range(1, 101)
def range(a,b):
Li=[]
while a<b:
Li.append(a)
a=a+1
return Li
print L[:10]
print L[2::3]
print L[4:50:5]
def range(a,b):
Li=[]
while a<b:
Li.append(a)
a=a+1
return Li
print L[:10]
print L[2::3]
print L[4:50:5]
2015-10-02
def move(n, a, b, c):
if n==1:
print a,'-->',c
else:
move(n-1,a,c,b)
print a,'-->',c
move(n-1,b,a,c)
move(4, 'A', 'B', 'C')
if n==1:
print a,'-->',c
else:
move(n-1,a,c,b)
print a,'-->',c
move(n-1,b,a,c)
move(4, 'A', 'B', 'C')
2015-10-02
def move(n, a, b, c):
if n==1:
print a,'-->',c
else:
move(n-1,a,c,b)
print a,'-->',c
move(n-1,b,a,c)
move(4, 'A', 'B', 'C')
if n==1:
print a,'-->',c
else:
move(n-1,a,c,b)
print a,'-->',c
move(n-1,b,a,c)
move(4, 'A', 'B', 'C')
2015-10-02
python解释执行 运行速度慢但是代码量少
C编译为机器码运行速度非常快 代码量非常多
Java编译为字节码运行速度快,代码量多
C编译为机器码运行速度非常快 代码量非常多
Java编译为字节码运行速度快,代码量多
2015-10-02