APP下载
首页
>
IT互联网
>
python选择填空题库练习
搜索
python选择填空题库练习
题目内容
(
简答题
)
50.已知字符串 s='我们班一共有 30 个人。‘,则表达式 len(s)的值为 。

答案:答案11

python选择填空题库练习
13.下列程序的输出结果是 。
https://www.shititong.cn/cha-kan/shiti/00045642-898c-b745-c0c9-4cc241d27c00.html
点击查看题目
34.以下程序的输出结果为 。
https://www.shititong.cn/cha-kan/shiti/00045648-dd47-01f9-c0c9-4cc241d27c00.html
点击查看题目
16.如果要对 E 盘 myfile 目录下的文本文件 abc.txt 进行读操作,文件打开方式应为( )
https://www.shititong.cn/cha-kan/shiti/00045642-89ad-74e9-c0c9-4cc241d27c00.html
点击查看题目
23.阅读以下程序,填写运行结果
https://www.shititong.cn/cha-kan/shiti/00045648-dd4d-92c7-c0c9-4cc241d27c00.html
点击查看题目
3.由字符串 s='this is a pen' 获得 This Is A Pen 的方法为( )
https://www.shititong.cn/cha-kan/shiti/00045642-8975-f013-c0c9-4cc241d27c00.html
点击查看题目
11.执行表达式 2+'1a'后,结果为( )
https://www.shititong.cn/cha-kan/shiti/00045642-897a-789a-c0c9-4cc241d27c00.html
点击查看题目
23.关于字符串下列说法错误的是( )
https://www.shititong.cn/cha-kan/shiti/00045642-897f-ca89-c0c9-4cc241d27c00.html
点击查看题目
31.表达式“1.0+2>1.0”的结果为()。
https://www.shititong.cn/cha-kan/shiti/00045648-dd40-54df-c0c9-4cc241d27c00.html
点击查看题目
5.已知字典 dic={'小明':1,'小红':2,'小李’:3},则以下表达式的值不为 3 的是( )。
https://www.shititong.cn/cha-kan/shiti/00045642-899c-c231-c0c9-4cc241d27c00.html
点击查看题目
12.阅读以下程序,填写运行结果
https://www.shititong.cn/cha-kan/shiti/00045648-dd4f-faa7-c0c9-4cc241d27c00.html
点击查看题目
首页
>
IT互联网
>
python选择填空题库练习
题目内容
(
简答题
)
手机预览
python选择填空题库练习

50.已知字符串 s='我们班一共有 30 个人。‘,则表达式 len(s)的值为 。

答案:答案11

python选择填空题库练习
相关题目
13.下列程序的输出结果是 。

A. 45

B. 0

C. 10

D. 55

https://www.shititong.cn/cha-kan/shiti/00045642-898c-b745-c0c9-4cc241d27c00.html
点击查看答案
34.以下程序的输出结果为 。
https://www.shititong.cn/cha-kan/shiti/00045648-dd47-01f9-c0c9-4cc241d27c00.html
点击查看答案
16.如果要对 E 盘 myfile 目录下的文本文件 abc.txt 进行读操作,文件打开方式应为( )

A.  open(”e:llmyfilellabc.txt”, ”x” )

B.  open(”e:\myfilellabc.txt”, ”r” )

C.  open(”e:\lmyfilellabc.txt”,”r+”)

D.  open( ”e:\myfilellabc.txt”, ”rb” )

解析:这个问题考察的是文件的打开方式。在 Windows 操作系统中,文件路径通常使用反斜杠"\"作为目录分隔符。
选项A中的"open("e:llmyfilellabc.txt", "x")"是错误的,因为"x"模式表示创建新文件,而不是读取文件。
选项B中的"open("e:\myfilellabc.txt", "r")"是正确的。"r"模式表示以只读方式打开文件,这样可以对 abc.txt 文件进行读操作。
选项C中的"open("e:\lmyfilellabc.txt","r+")"也是错误的,因为路径中多了一个"l"字符。
选项D中的"open("e:\myfilellabc.txt", "rb")"是错误的,因为"rb"模式表示以二进制只读方式打开文件,而题目要求的是文本文件的读操作。

https://www.shititong.cn/cha-kan/shiti/00045642-89ad-74e9-c0c9-4cc241d27c00.html
点击查看答案
23.阅读以下程序,填写运行结果
https://www.shititong.cn/cha-kan/shiti/00045648-dd4d-92c7-c0c9-4cc241d27c00.html
点击查看答案
3.由字符串 s='this is a pen' 获得 This Is A Pen 的方法为( )

A.  s.title()

B.  s.isupper()

C.  s.upper()

D.  s.capitalize()

https://www.shititong.cn/cha-kan/shiti/00045642-8975-f013-c0c9-4cc241d27c00.html
点击查看答案
11.执行表达式 2+'1a'后,结果为( )

A. 3

B.  '21a'

C.  报错

D.  '21

https://www.shititong.cn/cha-kan/shiti/00045642-897a-789a-c0c9-4cc241d27c00.html
点击查看答案
23.关于字符串下列说法错误的是( )

A.  字符串的子串查找函数 find()只能返回第-个符合子串的位置,否则返回为 0

B.  既可以用单引号,也可以用双引号创建字符家

C.  在三引号字符串中可以包含换行回车等特殊字符

D.  {:.2f}用于格式化输出数值时保留小数点后 2 位

https://www.shititong.cn/cha-kan/shiti/00045642-897f-ca89-c0c9-4cc241d27c00.html
点击查看答案
31.表达式“1.0+2>1.0”的结果为()。
https://www.shititong.cn/cha-kan/shiti/00045648-dd40-54df-c0c9-4cc241d27c00.html
点击查看答案
5.已知字典 dic={'小明':1,'小红':2,'小李’:3},则以下表达式的值不为 3 的是( )。

A.  dic.pop('小李’)

B.  dic['小李’]

C.  del dic['小李’]

D.  dic['小明’]+dic['小红’]

https://www.shititong.cn/cha-kan/shiti/00045642-899c-c231-c0c9-4cc241d27c00.html
点击查看答案
12.阅读以下程序,填写运行结果
https://www.shititong.cn/cha-kan/shiti/00045648-dd4f-faa7-c0c9-4cc241d27c00.html
点击查看答案
试题通小程序
试题通app下载