题库首页 › 青少年软件编程(Python) › 题目 17380

在Python中,如果想输出 He said, 'Hello',以下哪个选项正确地输出这个字符串? ( )

A: s = 'He said, 'Hello' ' print(s)
B: s = 'He said, \'Hello\' ' print(s)
C: s = \'He said, 'Hello'\' print(s)
D: s = "He said, Hello" print(s)

正确答案:B

在线做题 同科目题库