题目内容

请阅读下面的代码,选择正确的输出结果()。 word = 'Python' print(word[0], word[5], word[-1], word[-6])

A. P n o P
B. P o o P
C. P n n P
D. P n P n

查看答案
更多问题

假设x,y已经赋值,下列Python语句正确的是 ()

A. min = x if x < y else y
B. max = x > y ? x : y
C. if (x > y) print x
D. while True; pass

以下是字符转换成字节的方法是()

A. decode()
B. encode()
C. upper()
D. rstrip()

以下会出现错误的是()

A. ‘北京’.encode()
B. ‘北京’.decode()
C. ‘北京’.encode().decode()
D. 以上都不会错误

下面对count(),index(), find()方法描述错误的是

A. count() 方法用于统计字符串里某个字符出现的次数
B. find() 方法检测字符串中是否包含子字符串 str 如果包含子字符串返回开始的索引值,否则返回-1
C. index() 方法检测字符串中是否包含子字符串 str, 如果str不在,则返回-1
D. 以上都错误

答案查题题库