【判断题】
在Python中定义类时,运算符重载是通过重写特殊方法实现的。例如,在类中实现了mul()方法即可支持该类对象的**运算符。
A. 对
B. 错
查看试卷,进入试卷练习
微信扫一扫,开始刷题
答案
A
解析
暂无解析
相关试题
【判断题】
在IDLE交互模式下,一个下划线“_”表示解释器中最后一次显示的内容或最后一次语句正确执行的输出结果。
A. 对
B. 错
【判断题】
对于Python类中的私有成员,可以通过“对象名.类名_私有成员名”的方式来访问。
A. 对
B. 错
【判断题】
运算符 / 在Python 2.x和Python 3.x中具有相同的功能。
A. 对
B. 错
【判断题】
运算符“-”可以用于集合的差集运算。
A. 对
B. 错
【判断题】
如果定义类时没有编写析构函数,Python将提供一个默认的析构函数进行必要的资源清理工作。
A. 对
B. 错
【判断题】
已知seq为长度大于10的列表,并且已导入random模块,那么[random.choice(seq) for i in range(10)]和random.sample(seq,10)等价。
A. 对
B. 错
【判断题】
在派生类中可以通过“基类名.方法名()”的方式来调用基类中的方法。
A. 对
B. 错
【判断题】
Python支持多继承,如果父类中有相同的方法名,而在子类中调用时没有指定父类名,则Python解释器将从左向右按顺序进行搜索。
A. 对
B. 错
【判断题】
对文件进行读写操作之后必须显式关闭文件以确保所有内容都得到保存。
A. 对
B. 错
【判断题】
Python标准库os中的方法startfile()可以启动任何已关联应用程序的文件,并自动调用关联的程序。
A. 对
B. 错
【判断题】
程序中异常处理结构在大多数情况下是没必要的。
A. 对
B. 错
【判断题】
在try…except…else结构中,如果try块的语句引发了异常则会执行else块中的代码。
A. 对
B. 错
【判断题】
Python标准库threading中的Lock、RLock、Condition、Event、Semaphore对象都可以用来实现线程同步。
A. 对
B. 错
【判断题】
异常处理结构中的finally块中代码仍然有可能出错从而再次引发异常。
A. 对
B. 错
【判断题】
在GUI设计中,复选框往往用来实现非互斥多选的功能,多个复选框之间的选择互不影响。
A. 对
B. 错
【判断题】
在GUI设计中,单选按钮用来实现用户在多个选项中的互斥选择,在同一组内多个选项中只能选择一个,当选择发生变化之后,之前选中的选项自动失效。
A. 对
B. 错
【判断题】
在Python中定义类时实例方法的第一个参数名称必须是self。
A. 对
B. 错
【判断题】
在Python中定义类时实例方法的第一个参数名称不管是什么,都表示对象自身。
A. 对
B. 错
【判断题】
Python代码可以内嵌在asp文件中。
A. 对
B. 错
【判断题】
无法配置IIS来支持Python程序的运行。
A. 对
B. 错
【判断题】
Python标准库os中的方法startfile()可以用来打开外部程序或文件,系统会自动关联相应的程序来打开或执行指定的文件。
A. 对
B. 错
【判断题】
在编写应用程序时,应合理控制线程数量,线程并不是越多越好。
A. 对
B. 错
【判断题】
在多线程编程时,当某子线程的daemon属性为False时,主线程结束时会检测该子线程是否结束,如果该子线程尚未运行结束,则主线程会等待它完成后再退出。
A. 对
B. 错
【判断题】
Python只能使用内置数据库SQLite,无法访问MS SQLServer、ACCESS或Oracle、MySQL等数据库。
A. 对
B. 错
【判断题】
使用OpenGL画图时,画点是最基本的操作,具体生成的图形由glBegin()函数指定的mode来决定。例如,mode值为GL_TRIANGLES时表示将要绘制三角形。
A. 对
B. 错
【判断题】
OpenGL采用的“状态机”工作方式,一旦设置了某种状态以后,除非显式修改该状态,否则该状态将一直保持。
A. 对
B. 错
【判断题】
假设os模块已导入,那么列表推导式 [filename for filename in os.listdir(‘C:\Windows’) if filename.endswith(‘.exe’)] 的作用是列出C:\Windows文件夹中所有扩展名为.exe的文件。
A. 对
B. 错
【判断题】
表达式 list(‘[1, 2, 3]’) 的值是[1, 2, 3]。
A. 对
B. 错
【判断题】
在函数内部没有任何声明的情况下直接为某个变量赋值,这个变量一定是函数内部的局部变量。
A. 对
B. 错
【判断题】
定义类时如果实现了contains()方法,该类对象即可支持成员测试运算in。
A. 对
B. 错
【判断题】
定义类时如果实现了len()方法,该类对象即可支持内置函数len()。
A. 对
B. 错
【判断题】
定义类时实现了eq()方法,该类对象即可支持运算符==。
A. 对
B. 错
【判断题】
定义类时实现了pow()方法,该类对象即可支持运算符**。
A. 对
B. 错
【判断题】
二进制文件不能使用记事本程序打开。
A. 对
B. 错
【判断题】
使用普通文本编辑器软件也可以正常查看二进制文件的内容。
A. 对
B. 错
【判断题】
二进制文件也可以使用记事本或其他文本编辑器打开,但是一般来说无法正常查看其中的内容。
A. 对
B. 错
【判断题】
Python标准库os中的方法isfile()可以用来测试给定的路径是否为文件。
A. 对
B. 错
【判断题】
Python标准库os中的方法exists()可以用来测试给定路径的文件是否存在。
A. 对
B. 错
【判断题】
Python标准库os中的方法isdir()可以用来测试给定的路径是否为文件夹。
A. 对
B. 错
【判断题】
Python标准库os中的方法listdir()返回包含指定路径中所有文件和文件夹名称的列表。
A. 对
B. 错
推荐试题
【单选题】
Tom is a book lover. ______ likes reading very much. A. He B. She C. You D. It
A. A
B. B
C. C
D. D
【单选题】
—May I listen to the music here, Mr. White? —Sorry, you’d better it like that. A. not to do B. not do to C. dont do D. not do
A. A
B. B
C. C
D. D
【单选题】
3.—Did you have a good time at Lauras birthday party? — Yes, indeed. Its several years ________ I enjoyed myself so much. A. when B. before C. since D. that
A. A
B. B
C. C
D. D
【单选题】
4. —___________ is the Summer Palace from here? About three kilometers away. You can take the No. 35 bus. A. How long B. How far C. How often D. How much
A. A
B. B
C. C
D. D
【单选题】
5. I was looking for a birthday gift for my mother, but I couldnt find ______ suitable. A. anything B. something C. nothing D. everything
A. A
B. B
C. C
D. D
【单选题】
6. A friend of my ____ and I are going to visit_______ next week. A. father; Browns B. father's; Browns C. father; the Browns D. father's; the Browns
A. A
B. B
C. C
D. D
【单选题】
7. She ______ very hard since she came to our school. A. studies B. has studied C. is studying D. studied
A. A
B. B
C. C
D. D
【单选题】
8. — Who will send you to the new school, your mom or your dad? — _______. Ill go there by myself. A. Both B. Either C. Neither D. None
A. A
B. B
C. C
D. D
【单选题】
9.—Well do what we can ____English well this term. —It’s high time for you to work hard. A. study  B.to study  C. be studied   D. be studying
A. A
B. B
C. C
D. D
【单选题】
10. —I’m going to Flower Bookstore. Could you tell me ______? — Sorry, I don’t know. I’m new here. A. where it is B. where was it C. where is it D. where it was
A. A
B. B
C. C
D. D
【单选题】
11. How do you like the dishes, Eric? — Fantastic! Nothing tastes ________. A. nice B. better C. terrible D. worse
A. A
B. B
C. C
D. D
【单选题】
12. ______ Lin Feng has to work late, she always wears a smile on her face. A. Because B. If C. Until D. Though
A. A
B. B
C. C
D. D
【单选题】
13.You can save money _______ you buy cheaper things. A. before B. unless C. if D. until
A. A
B. B
C. C
D. D
【单选题】
14. We will have a _________ holiday after the exam. A. two-month B. two month’s C. two month D. two-months
A. A
B. B
C. C
D. D
【单选题】
15. —We will build an underground in Xuzhou before 2015. — Wow, _______! Will it pass our place? A. what an excited news B. how excited the news is C. what exciting news D. how exciting
A. A
B. B
C. C
D. D
【单选题】
16. — Emily, here’s a dictionary.I hope it will help you in some way. — Thank you.It’s ________ what I need. A. almost B. still C. only D. just
A. A
B. B
C. C
D. D
【单选题】
17. —Oh.I’m hungry.Mum, can I have the hamburger on the plate? —No.It tastes . A. terribly B. terrible C. good D. well
A. A
B. B
C. C
D. D
【单选题】
18. —We can invite our teachers to the farewell party next Saturday. —Yes, ______? I’ll call them at once. A. what for B. what C. why not D. why
A. A
B. B
C. C
D. D
【单选题】
19.You can ________ ask the old man to move away to any other place because he has lived ________ here for at least sixty years. A. hardly; alone B. hard; alone C. hardly; lonely D. hardly; lonely
A. A
B. B
C. C
D. D
【单选题】
20.—I’m going back to see my grandparents this weekend. —________. A. It’s very nice of you B. You’d better hurry C. Say goodbye to them D. Give my best wishes to them
A. A
B. B
C. C
D. D
【单选题】
21.—Why not take ____ umbrella with the sign “Made in China”? It is useful. —What _______ good advice it is!    A. an; a B. a; a C. an; \ D. \; a
A. A
B. B
C. C
D. D
【单选题】
22. —Do you know the boy________ is sitting next to Peter? — Yes. He is Peter’s friend. They are celebrating his ________ birthday. A. who; ninth B. that; ninth C. /; ninth D. which; ninth
A. A
B. B
C. C
D. D
【单选题】
23. It was dark, ______ I couldnt see what was happening. A. or B. though C. but D. so
A. A
B. B
C. C
D. D
【单选题】
24.—You can use MSN to talk with Vivien on the Internet. —I know. But can you tell me ________? A. what I can use it B. when I can use it C. why can I use it D. how can I use it
A. A
B. B
C. C
D. D
【单选题】
25. _______ are you going to the School Uniform Exhibition, Amy ? To learn about different styles of school uniform. A. What B. Where C. Which D. Why
A. A
B. B
C. C
D. D
【单选题】
( ) 26. Where does the writer of "The little Prince" come from? A.England. B.France. C.America. D.China.
A. A
B. B
C. C
D. D
【单选题】
( ) 27. What does the prince do after the fox tells him a secret? A.He cares more about a flower and a sheep. B.He meets many more strange adults on other planets. C.He realizes his love for the rose and he goes back to his planet.   D.He discovers interesting things such as a snake, other roses and a fox
A. A
B. B
C. C
D. D
【单选题】
( ) 28. What does "The little Prince" mainly talk about? It' s about _________. A.the adult world B.the planet B -612 C.a rose and a fox D.the adventure of a young prince
A. A
B. B
C. C
D. D
【单选题】
( ) 29. What is the writer's main purpose(目的)in writing this passage?    A.To tell the readers his life story.    B.To tell people what kind of person his father was.    C.To tell the readers what present he got from his father.    D. To let people know how poor he was.
A. A
B. B
C. C
D. D
【单选题】
( ) 30. Why did the father not ask his son not to do this and do that?    A.Because he felt quite confident of his son.    B.Because he was born from a poor family.    C.Because he was a man of few words.    D.Because he didn't want to be much too strict with his son.
A. A
B. B
C. C
D. D
【单选题】
( ) 31. What would someone learn from this passage?    A.How to live by oneself. B.How to stand on one's own feet.    C.What a good father should do. D.What the self-important is like.
A. A
B. B
C. C
D. D
【单选题】
( ) 32. What may be the proper Chinese for the underlined part in the passage?    A.闲暇时光 B.学费 C.精神空虚 D.经济不足
A. A
B. B
C. C
D. D
【单选题】
( ) 33. Why did Natalie Smith pay for the six cars behind her? A. She had seven tickets. B. She hoped to please others. C. She knew the car drivers well. D. She wanted to show kindness.
A. A
B. B
C. C
D. D
【单选题】
( ) 34. Judy Foreman copied down the phrase because she ___ . A. thought it was beautifully written B. wanted to know what it really meant C. decided to write it on a warehouse wall D. wanted her husband to put it up in the classroom
A. A
B. B
C. C
D. D
【单选题】
( ) 35. Who came up with the phrase according to the passage? A. Judy Foreman. B. Natalie Smith. C. Anne Herbert D. Alice Johnson.
A. A
B. B
C. C
D. S
【单选题】
( ) 36. What can we infer from the last paragraph? A. People should practice random kindness to those in need. B. People who receive kindness are likely to offer it to others. C. People should practice random kindness to strangers they meet. D. People who receive kindness are likely to pay it back to the giver.
A. A
B. B
C. C
D. D
【单选题】
( ) 37.The greatest river for navigation is ___________. A. the Nile B. the Amazon C. the Mekong D. the Mississippi
A. A
B. B
C. C
D. D
【单选题】
( ) 38. From a dam, people can use the water for ___________. A. keeping the rivers clean B. only making electricity C. irrigation and making electricity D. washing clothes
A. A
B. B
C. C
D. D
【单选题】
( ) 39. The water in the river is polluted because of _____________. A. people's drinking water too much B. people's swimming in the river too much C. chemicals and other materials D. people's building a dam across a river
A. A
B. B
C. C
D. D
【单选题】
( ) 40. The best title of the passage is ___________. A. Rivers in Cities B. The importance of Rivers C. Transportation D. Natural Resources
A. A
B. B
C. C
D. D