有一个字符串变量s = 'python program',语句print(s[-3:-1]) 的输出结果是:
A. 没有显示结果
B. ram
C. ra
D. gra
查看答案
有一个字符串变量s = 'python program',语句print(s[1:5:2]) 的输出结果是:
A. pto
B. yh
C. yhn
D. ython
有一个字符串变量s = 'python program',语句print(s[::-1]) 的输出结果是:
A. margorp nohtyp
B. python program
C. yhn
D. ython
有一个字符串变量s = 'python program',输出语句print(s[::-2]) 的输出结果是什么?
A. pto rga
B. mropnhy
C. yhnporm
D. margorp nohtyp
有一个字符串变量s = 'python program',语句print( s[ : : ] )的输出结果是什么?
A. program
B. margorp nohtyp
C. python program
D. python