执行以下代码,运行结果()。 defsplit(s): returnsplit(“a”) s=’Happybirthdaytoyou!’ print(split(s))
A: [‘H’,‘ppybirthd’,‘ytoyou!’]
B: “Happybirthdaytoyou!”
C: 程序执行错误
D: [‘Happy’,‘birthday’,‘to’,‘you!’]
A: [‘H’,‘ppybirthd’,‘ytoyou!’]
B: “Happybirthdaytoyou!”
C: 程序执行错误
D: [‘Happy’,‘birthday’,‘to’,‘you!’]
举一反三
- 执行以下代码,运行结果defsplit(s):returns.split("t")s="Happybirthdaytoyou!"print(split(s)) A: 运行出错 B: ["&quot","Happy&quot",null,"&quot","birthday&quot",null,"&quot","to&quot",null,"&quot","you!&quot"] C: ["Happybir","&nbsp","hday","&nbsp","oyou!"] D: ["Happy","&nbsp","bir","&nbsp","hday","&nbsp","o","&nbsp","you!"]
- 下面代码的执行结果是()。>;>;>;x="HappyBirthdaytoyou!">;>;>;x*3 A: 系统报错 B: HappyBirthdaytoyou! C: HappyBirthdaytoyou!HappyBirthdaytoyou!HappyBirthdaytoyou! D: 'HappyBirthdaytoyou!HappyBirthdaytoyou!HappyBirthdaytoyou!'
- x="HappyBirthdaytoyou!"[br][/br]>>>x*3[br][/br]代码的执行结果是() A: 系统报错 B: 'HappyBirthdaytoyou!HappyBirthdaytoyou!HappyBirthdaytoyou!' C: HappyBirthdaytoyou!<br>HappyBirthdaytoyou!<br>HappyBirthdaytoyou! D: HappyBirthdaytoyou!
- 阅读程序,写出下列程序运行结果。def split(s): return s.split('a') s='an apple a day' print(split(s),s.split())
- 执行下面代码:s = "Python"print(s[3:1:-1])输出结果为()