题目内容

假设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. 以上都错误

字符串是一个字符序列,给字符串s,以下表示s从右侧向左第三个字符的是:

A. s[-3]
B. s[3]
C. s[0:-3]
D. s[:-3]

答案查题题库