这个任务有点简单,可以改一下,让他输出
I’m student,my name is BOB. I like basketball
I‘m Teacher,my name is ALI. I like football
I’m student,my name is BOB. I like basketball
I‘m Teacher,my name is ALI. I like football
2015-10-28
def format_name(s):
return s[:1].upper()+s[1:].lower();
print map(format_name, ['adam', 'LISA', 'barT'])
return s[:1].upper()+s[1:].lower();
print map(format_name, ['adam', 'LISA', 'barT'])
2015-10-27
def format_name(s):
return s.lower().capitalize()
#return s[:1].upper()+s[1:].lower()
print map(format_name, ['adam', 'LISA', 'barT'])
return s.lower().capitalize()
#return s[:1].upper()+s[1:].lower()
print map(format_name, ['adam', 'LISA', 'barT'])
2015-10-27
sorted, cmp=lambda s1, s2: cmp(s1.upper(), s2.upper())) 不懂。求大神 帮忙解释一下
2015-10-26
#辗转相除法
def gcd(p,q):
if p<q:
p,q=q,p
while q!=0:
p,q=q,p%q
return p
def gcd(p,q):
if p<q:
p,q=q,p
while q!=0:
p,q=q,p%q
return p
2015-10-24