Discuss / Python / 现在才知道python的强大

现在才知道python的强大

Topic source

LeborYi

#1 Created at ... [Delete] [Delete and Lock User]
print('L1 = [\'Hello\', \'World\', 18, \'Apple\', None]')
print('把L1中所有的字符串变成小写:',end = '')
print([s.lower() for s in L1 if isinstance(s,str)])

LeborYi

#2 Created at ... [Delete] [Delete and Lock User]

少了一行

L1 = ['Hello', 'World', 18, 'Apple', None]

Leo_dyfang

#3 Created at ... [Delete] [Delete and Lock User]

,end = ''是什么意思呀

不写end=''则输入后换行,写了则不换行; 实际上print默认输出是换行的 print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False) ,写了end=''则替代了end='\n'


  • 1

Reply