for x in range(11,100):
n = x / 10
m = x % 10
if n < m:
print(x)
n = x / 10
m = x % 10
if n < m:
print(x)
2015-09-30
import math
def quadratic_equation(a, b, c):
temp=b*b-4*a*c
if temp <0:
print "error"
else :
x=(-1*b- math.sqrt(temp))/(2*a)
y=(-1*b+ math.sqrt(temp))/(2*a)
return y,x
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
def quadratic_equation(a, b, c):
temp=b*b-4*a*c
if temp <0:
print "error"
else :
x=(-1*b- math.sqrt(temp))/(2*a)
y=(-1*b+ math.sqrt(temp))/(2*a)
return y,x
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
2015-09-30
t = ('a', 'b', ['A', 'B'])
L = t[2]
L[0] = ('a')
L[1] = ('b')
#t = tuple(t)
print t
L = t[2]
L[0] = ('a')
L[1] = ('b')
#t = tuple(t)
print t
2015-09-29
print 45678+0x12fd2
print 'learn python in imooc'
print 100<99 ;print 0xff==255
第二个不能有大写;
第三个99后面加个分号,我这个可以提交
print 'learn python in imooc'
print 100<99 ;print 0xff==255
第二个不能有大写;
第三个99后面加个分号,我这个可以提交
2015-09-28
哎 自己写的通不过
d = {
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
for name,value in d.items():
print "%s:%d" % (name,value)
d = {
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
for name,value in d.items():
print "%s:%d" % (name,value)
2015-09-28
L = ['Adam', 'Lisa', 'Paul', 'Bart']
L.pop()
L.pop()
print L
我这样的也过了
L.pop()
L.pop()
print L
我这样的也过了
2015-09-28
d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59, 'Paul': 74 }
sum = 0.0
for item in d.values():
sum = sum + item
print sum/len(d)
sum = 0.0
for item in d.values():
sum = sum + item
print sum/len(d)
2015-09-27