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
2015-07-29
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for index, name in enumerate(L):
print index+1, '-', name
我能说这样也算作弊了么?
for index, name in enumerate(L):
print index+1, '-', name
我能说这样也算作弊了么?
x1 = 1
d = 3
n = 100
x100 = x1+(n-1)*d
s = n*(x1+x100)/2
print s
d = 3
n = 100
x100 = x1+(n-1)*d
s = n*(x1+x100)/2
print s
2015-07-28
print 'hello,python.'
print "hello,python."
print 'hello,','python'
print "hello,python."
print 'hello,','python'
2015-07-28
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
2015-07-28
print 'hello,python.'
print 'hello,'+'pyhton'
print 'hello,'+'pyhton'
2015-07-28
print '100<90',100<90
print '0xff==255',0xff==255
print 'Learn Python in imooc'
print 45678+0x12fd2
print '0xff==255',0xff==255
print 'Learn Python in imooc'
print 45678+0x12fd2
2015-07-28
import math
def quadratic_equation(a, b, c):
x=(-b+math.sqrt(b*b-4*a*c))/(2*a)
y=(-b-math.sqrt(b*b-4*a*c))/(2*a)
return x,y
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
def quadratic_equation(a, b, c):
x=(-b+math.sqrt(b*b-4*a*c))/(2*a)
y=(-b-math.sqrt(b*b-4*a*c))/(2*a)
return x,y
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
2015-07-27
t = (0,1,2,3,4,5,6,7,8,9)
print t
m = 0,1,2,3,4,5,6,7,8,9
print m
n = tuple(range(10))
print n
print t
m = 0,1,2,3,4,5,6,7,8,9
print m
n = tuple(range(10))
print n
2015-07-26