10.以下程序的输出结果是
https://www.shititong.cn/cha-kan/shiti/00045642-898b-1cc2-c0c9-4cc241d27c00.html
点击查看答案
3.在 IDLE 的文件式运行环境下,执行程序的快捷键为( )
https://www.shititong.cn/cha-kan/shiti/00045642-8954-7faa-c0c9-4cc241d27c00.html
点击查看答案
27.在屏幕上输出“你好”的 Python 语句是()
A. print“你好”
B. print(你好)
C. print(”你好”)
D. print 你好
https://www.shititong.cn/cha-kan/shiti/00045642-8973-b031-c0c9-4cc241d27c00.html
点击查看答案
11.下列程序的输出结果是( )
https://www.shititong.cn/cha-kan/shiti/00045648-dd4f-c2c3-c0c9-4cc241d27c00.html
点击查看答案
22.
![](https://yi2.oss-cn-shenzhen.aliyuncs.com/ce5e3ddc03fb419580ce132672514dd0.png)
以上程序的输出结果为: 。
A. True
B. 5
C. False
D. 无输出
https://www.shititong.cn/cha-kan/shiti/00045642-8991-913a-c0c9-4cc241d27c00.html
点击查看答案
16.下列程序的输出结果是:( )
https://www.shititong.cn/cha-kan/shiti/00045642-89a6-c794-c0c9-4cc241d27c00.html
点击查看答案
1.for 循环次数是根据( )确定的。
A. 逻辑结果
B. 固定参数
C. 遍历结构中元素个数
D. 遍历结构
https://www.shititong.cn/cha-kan/shiti/00045642-8986-ae0a-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
点击查看答案
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
点击查看答案
12.可使用以下哪已知字符串 s=lcan see green.,个语句改变 s 的值,去除其中的英文句号( )。
A. s.replace(” ,'')
B. s=s.replace(” ,'.)
C. s.replace('' , ”)
D. s=s.replace('. ,”)
https://www.shititong.cn/cha-kan/shiti/00045642-897a-e983-c0c9-4cc241d27c00.html
点击查看答案