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
s = set([('Adam', 95), ('Lisa', 85), ('Bart', 59)])
for x in s:
# print str(x[0]),':',str(x[1])
print '%s:%s'%x
for x in s:
# print str(x[0]),':',str(x[1])
print '%s:%s'%x
2015-07-26
for x in range(1,9):
for y in range(x+1,10):
print str(x)+str(y)
这个写法好牛逼的说,首先,取x为枚举1`9.然后取y为比x至少大1,一直到10的枚举。然后用str返回其字符串,放在一起就ok了。
for y in range(x+1,10):
print str(x)+str(y)
这个写法好牛逼的说,首先,取x为枚举1`9.然后取y为比x至少大1,一直到10的枚举。然后用str返回其字符串,放在一起就ok了。
2015-07-26