题海
让大学四年没有难题
首页
搜题
登陆
题目详情
单选题
使用( )符号对浮点类型的数据进行格式化
A.
%c
B.
%f
C.
%d
D.
%s
查看答案
学科:
Python程序设计
时间:
2025-06-06 07:39:29
相关题目
相关作业
题目1
单选题
输入一个字符串s,反向输出它,例如输入"abc",输出"bca"s=input()__________while i>=0: print(s[i],end="")print()
A. i=len(s)
B. i=len(s)-1
C. i=len(s)+1
D. 都不对
题目2
单选题
题目:输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数.'''需求:输入一行字符,分别统计出其中英文字母、空格,数字和其他字符的个数.思路:利用while语句,条件为输入的字符'''s = input('input a string:')letters = 0space = 0digit = 0others = 0for c in s: if c.isalpha(): letters += 1 elif c.isspace(): space += 1 elif _________: digit += 1 else: others += 1print('char = %d, space = %d,digit = %d,others = %d' % (letters,space,digit,others))
A. c.isDigit()
B. c.Digit()
C. c.IsDigit()
D. c.isdigit()
题目3
单选题
输入学生姓名,增加到一个列表st中,直到输入的姓名为空为止,最后输出st.s=[]while True: s=input() if s!="": __________ else: breakprint(st)
A. st.insert(s)
B. st.add(s)
C. st.append(s)
D. s.append(st)
题目4
单选题
当需要在字符串中使用特殊字符时,Python使用( )作为转义字符的起始符号
A. \
B. /
C. #
D. %
题目5
单选题
下列数据中,不属于字符串的是( )
A. 'ab'
B. '''perface'''
C. "52wo"
D. abc
题目6
单选题
使用( )符号对浮点类型的数据进行格式化
A. %c
B. %f
C. %d
D. %s
题目7
单选题
字符串'Hi,Andy'中,字符'A'对应的下标位置为( )
A. 1
B. 2
C. 3
D. 4
题目8
单选题
下列方法中,能够返回某个子串在字符串中出现次数的是( )
A. length()
B. index()
C. count()
D. find()
题目9
单选题
下列方法中,能够让所有单词的首字母变成大写的方法是( )
A. capitalize
B. title
C. upper
D. ljust
题目10
单选题
字符串的strip方法的作用是( )
A. 删除字符串头尾指定的字符
B. 删除字符串末尾指定的字符
C. 删除字符串头部指定的字符
D. 通过指定分隔符对字符串切片
下载
题海APP
拍照搜题更快捷
海量题库
无搜索限制
快捷拍照搜题
扫描他!然后带走我~