已知s=”Python语言程序设计”,则print(s[2:4])的输出结果为()。
A: yt
B: th
C: ytho
D: thon
A: yt
B: th
C: ytho
D: thon
举一反三
- 已知s="Python语言程序设计",则print(s[2:4])的输出结果为 ,print(s[-4:-2])的输出结果为 。
- 已知s="Python语言程序设计",则 print(s[1:4])的输出结果为( ), print(s[-3:-2])的输出结果为( ), print(s[-4:2])的输出结果为( ). 3分
- 已知s="Python语言程序设计",则 print(s[1:4])的输出结果为( ), print(s[-3:-2])的输出结果为( ), print(s[-4:2])的输出结果为( ). 3分
- 写出并理解下列语句输出的结果s="hello"print(s[0])print(s[4])print(s[-1])print(s[0:3])print(s[0:4:2])print(s[:])print(s[:3])print(s[::-1])print(s[1:])
- 执行下面代码:s = "Python"print(s[3:1:-1])输出结果为() A: th B: ht C: oh D: ho