• 2022-06-05
    ‎由字符串 s = 'hello world' 获得 'Hello World' 的方法为?‎
    A: s.title()
    B: s.capitalize()
    C: s.upper()
    D: s.isupper()
  • A

    内容

    • 0

      设s = "Hello world",若想获得“world”子串,可以使用切片操作()。 A: s[6:10] B: s[-5:] C: s[6:-1] D: s[-6:]

    • 1

      下面程序段的输出结果是_______。for s in "Hello, World!": if s==",": break print(s,end="") A: Hello, B: Hello,World! C: , D: Hello

    • 2

      for s in "hello world": A: hello world B: world C: hello D: helloworld

    • 3

      下面代码的输出结果是()for s in “Hello World”:if s==”W”:contineprint(s,end=” “) A: Hello orld B: Hello C: World D: HelloWorld

    • 4

      给定字符串s=hello world,获取hello的切片表达式为________。