Discuss / Python / 作业 (┬_┬)

作业 (┬_┬)

Topic source

LeborYi

#1 Created at ... [Delete] [Delete and Lock User]
#第一题
print(list(map(lambda s : s[0].upper() + s[1:].lower(),['dmin','LISA','barT'])))
'想到切片了,但是不会使用.upper 与 .lower'

#第二题
from functools import reduce 
print('1*2*3*4*5=',end = '')
print(reduce(lambda x,y : x * y,[1,2,3,4,5]))
'print()不换行语句,在需要打印的''后面跟end=''  '

#第三题
'不会 睡觉!'

  • 1

Reply