单项选择题
在Python中,如何从一个字符串中删除特定字符?()
A.str.replace(char,’’)
B.str.remove(char)
C.str.delete(char)
D.del str[char]
点击查看答案&解析
相关考题
-
单项选择题
在Python中,如何获取列表的长度?()
A.len(list)
B.list.length()
C.list.size()
D.list.len() -
单项选择题
在Python中,如何创建一个自定义异常?()
A.class MyException(Exception):pass
B.create Exception(’MyException’)
C.exception MyException
D.new Exception(’MyException’) -
单项选择题
在Python中,如何使用正则表达式匹配一个字符串?()
A.re.match(pattern,string)
B.string.match(pattern)
C.pattern.match(string)
D.regex.match(string,pattern)
