python

更新时间: 试题数量: 购买人数: 提供作者:

有效期: 个月

章节介绍: 共有个章节

收藏
搜索
题库预览
请阅读下面的代码: def many_param(num_one, num_two, *args): print(args) many_param(11, 22, 33, 44, 55) 运行代码,输出结果为(  )。 (11,22,33) (22,33,44) (33,44,55) (11,22) 打开一个已有文件,在文件末尾添加信息,正确的打开方式为(  )。 r w a w+ 假设文件不存在,如果使用open()方法打开文件会报错,那么该文件的打开方式是下列哪种?(  ) r w a w+ 假设file是文本文件对象,下列哪个选项可读取file的一行内容?(  ) file.read() file.read(200) file.readline() file.readlines() 下列选项中,用于向文件中写入数据的是(  )。 open() write() close() read() 下列选项中,用于获取当前目录的是(  )。 open() write() getcwd() read() 下列代码要打开的文件应该在(  )。 f = open('itheima.txt', 'w') C盘根目录 D盘根目录 Python安装目录 程序所在目录 若文本文件abc.txt中的内容如下: abcdef 阅读下面的程序: file = open('abc.txt', 'r') data = file.readline() data_list = list(data) print(data_list) 以上程序的执行结果为(  )。 ['abcdef'] ['abcdef\n'] ['a', 'b', 'c', 'd', 'e', 'f'] ['a', 'b', 'c', 'd', 'e', 'f', '\t'] 下列方法中,负责初始化属性的是(  )。 __del__() __init__() __init() __add__() 下列选项中,不属于面向对象三大重要特性的是(  )。 抽象 封装 继承 多态 请阅读下面的代码: class Test: count = 10 def print_num(self): print(self.count) test= Test() test.print_num() 运行代码,输出结果为(  )。