d = {
'adam':95,
'lisa':85,
'bart':59
}
score=input()
for i in d.keys():
if d[i]==score:
print i
'adam':95,
'lisa':85,
'bart':59
}
score=input()
for i in d.keys():
if d[i]==score:
print i
2016-12-16
d = {
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
for i in d.keys():
print i,d[i]
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
for i in d.keys():
print i,d[i]
2016-12-16
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')
简单易懂的方法
2016-12-16
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for index, name in zip(range(1,5),L):
print index, '-', name
for index, name in zip(range(1,5),L):
print index, '-', name
n=0
x=9
for i in range(1,10):
for j in range(1,10):
if i<j:
x=10*i+j
print "x is:",x
n=n+1
print "n:",n
x=9
for i in range(1,10):
for j in range(1,10):
if i<j:
x=10*i+j
print "x is:",x
n=n+1
print "n:",n
2016-12-15
list1=[e for e in range(0,10)]
#print list1
t1=tuple(list1)
print t1
#print list1
t1=tuple(list1)
print t1
2016-12-15