以下对于字符串的相关操作,正确的输出结果是哪些选项?
A: >;>;>;'Lifeisshort,youneedPython.'.find('you') 15
B: >;>;>;print('you'in'Lifeisshort,youneedPython.') True
C: >;>;>;seq=[1,2,3,4]; >;>;>;sep='+'; >;>;>;sep.join(seq) '1+2+3+4'
D: >;>;>;print('{:5.3f}'.format(math.pi)) 3.1416
A: >;>;>;'Lifeisshort,youneedPython.'.find('you') 15
B: >;>;>;print('you'in'Lifeisshort,youneedPython.') True
C: >;>;>;seq=[1,2,3,4]; >;>;>;sep='+'; >;>;>;sep.join(seq) '1+2+3+4'
D: >;>;>;print('{:5.3f}'.format(math.pi)) 3.1416
举一反三
- 以下对于字符串的相关操作,正确的输出结果是哪些选项? A: >>> 'Life is short, you need Python.'.find('you') 15 B: >>> seq = [1, 2, 3, 4]; >>> sep = '+'; >>> sep.join(seq) '1+2+3+4' C: >>> print '%05.3f' % math.pi 3.1416 D: >>> print 'you' in 'Life is short, you need Python.' True
- 以下对于字符串的相关操作,正确的输出结果是哪些选项? A: >>> 'Life is short, you need Python.'.find('you') 15 B: >>> seq = [1, 2, 3, 4]; >>> sep = '+'; >>> sep.join(seq) '1+2+3+4' C: >>> print('{:5.3f}'.format(math.pi)) 3.1416 D: >>> print('you' in 'Life is short, you need Python.') True
- Which output of the following choices is correct A: print('{:5.3f}'.format(math.pi)) <br>3.1416 B: 'Life is short, you need Python'. find('Life') <br>1 C: print('you' in 'Life is short, you need Python.') <br>True D: seq = [1, 2, 3, 4] <br>>>> sep = '+' <br>>>> sep.join(seq) <br>'1+2+3+4'
- Python 3.x语句 print(1, 2, 3, sep=':') 的输出结果是:
- 写出下列语句的输出结果:print(1 or 2, 0 or 2, False or True,True or False,False or 2,sep=' ')print(1 and 2, 0 and 2, False and 2,True and 2,False and True,sep=' ')