阅读程序,写出下列程序运行结果。def split(s): return s.split('a') s='an apple a day' print(split(s),s.split())
举一反三
- s='an apple a day'def split(s):return s.split('a')s.split() A: ['an', 'apple', 'a', 'day'] B: 在函数定义时报错 C: 'an', 'apple', 'a', 'day' D: 在最后一行报错
- 执行以下代码,运行结果()。 defsplit(s): returnsplit(“a”) s=’Happybirthdaytoyou!’ print(split(s)) A: [‘H’,‘ppybirthd’,‘ytoyou!’] B: “Happybirthdaytoyou!” C: 程序执行错误 D: [‘Happy’,‘birthday’,‘to’,‘you!’]
- It's no use_____over split milk.
- 写出下面程序的输出结果public class Test { public static void main(String srgs[]) { String s = "Mary,F,1990"; String sPlit[] = s.split(","); for(int i = 0;i<sPlit.length;i++) { System.out.print(sPlit[i]+"-"); } }}[/i]
- 写出下列程序的运行结果 s='abcdefg' print(s[3]) print(s[3:5]) print(s[:5]) print(s[3:]) print(s[::2]) print(s[::-1]) print(s[-2:-5])