相关试题
【判断题】
如果在设计一个类时实现类len()方法,那么该类的对象会自动支持Python内置函数len()。
【判断题】
Python 3.x中字符串对象的encode()方法默认使用utf8作为编码方式。
【判断题】
已知x = ‘hellow world.’.encode(),那么表达式x.decode(‘gbk’)的值为’hellow world.’。
【判断题】
已知x = ‘Python是一种非常好的编程语言’.encode(),那么表达式x.decode(‘gbk’)的值为’Python是一种非常好的编程语言’。
【判断题】
正则表达式’^http’只能匹配所有以’http’开头的字符串。
【判断题】
正则表达式’^\d{18}|\d{15}$’只能检查给定字符串是否为18位或15位数字字符,并不能保证一定是合法的身份证号。
【判断题】
二进制文件也可以使用记事本程序打开,只是无法正确阅读和理解其中的内容。
【判断题】
正则表达式’[^abc]’可以一个匹配任意除’a’、’b’、’c’之外的字符。
【判断题】
正则表达式’python|perl’或’p(ython|erl)’都可以匹配’python’或’perl’。
【判断题】
文本文件是可以迭代的,可以使用for line in fp类似的语句遍历文件对象fp中的每一行。
【判断题】
Python的主程序文件python.exe属于二进制文件。
【判断题】
使用记事本程序也可以打开二进制文件,只不过无法正确识别其中的内容。
【判断题】
对字符串信息进行编码以后,必须使用同样的或者兼容的编码格式进行解码才能还原本来的信息。
【判断题】
使用pickle进行序列化得到的二进制文件使用struct也可以正确地进行反序列化。
【判断题】
已知当前文件夹中有一个文件readme.txt具有只读属性,假设标准库os已正确导入,那么可以通过语句os.chmod(‘readme.txt’, 0o777)来删除该文件的只读属性。
【判断题】
Python标准库os的函数remove()不能删除具有只读属性的文件。
【判断题】
字节串b’hello world’和b’hello world.’的MD5值相差很小。
【判断题】
由于异常处理结构try…except…finally…中finally里的语句块总是被执行的,所以把关闭文件的代码放到finally块里肯定是万无一失,一定能保证文件被正确关闭并且不会引发任何异常。
【判断题】
使用TCP协议进行通信时,必须首先建立连接,然后进行数据传输,最后再关闭连接。
【判断题】
TCP是可以提供良好服务质量的传输层协议,所以在任何场合都应该优先考虑使用。
【判断题】
在4核CPU平台上使用多线程编程技术可以很轻易地获得400%的处理速度提升。
【判断题】
多线程编程技术主要目的是为了提高计算机硬件的利用率,没有别的作用了。
【填空题】
1、 Python安装扩展库常用的是_工具。___
【填空题】
2、 Python标准库math中用来计算平方根的函数是____。___
【填空题】
3、 Python程序文件扩展名主要有__和两种,其中后者常用于GUI程序。___
【填空题】
4、 Python源代码程序编译后的文件扩展名为___。___
【填空题】
5、 使用pip工具升级科学计算扩展库numpy的完整命令是_______。___
【填空题】
6、 使用pip工具查看当前已安装的Python扩展库的完整命令是___。___
【填空题】
7、 在IDLE交互模式中浏览上一条语句的快捷键是____。___
【填空题】
8、 使用pip工具查看当前已安装Python扩展库列表的完整命令是___。___
【填空题】
9、 在Python中____表示空类型。___
【填空题】
10、 列表、元组、字符串是Python的______序列。___
【填空题】
11、 查看变量类型的Python内置函数是______。___)
【填空题】
12、 查看变量内存地址的Python内置函数是_______。___)
【填空题】
13、 以3为实部4为虚部,Python复数的表达形式为_或__。___
【填空题】
14、 Python运算符中用来计算整商的是___。___
【填空题】
15、 Python运算符中用来计算集合并集的是_。___
【填空题】
16、 使用运算符测试集合包含集合A是否为集合B的真子集的表达式可以写作_。___
【填空题】
17、 表达式[1, 2, 3]*3的执行结果为____________。___
【填空题】
18、 list___)的执行结果为___________。___
推荐试题
【单选题】
Tom is a book lover. ______ likes reading very much.
A. He B. She C. You D. It
【单选题】
—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
【单选题】
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
【单选题】
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
【单选题】
5. I was looking for a birthday gift for my mother, but I couldnt find ______ suitable.
A. anything B. something C. nothing D. everything
【单选题】
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
【单选题】
7. She ______ very hard since she came to our school.
A. studies B. has studied C. is studying D. studied
【单选题】
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
【单选题】
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
【单选题】
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
【单选题】
11. How do you like the dishes, Eric?
— Fantastic! Nothing tastes ________.
A. nice B. better C. terrible D. worse
【单选题】
12. ______ Lin Feng has to work late, she always wears a smile on her face.
A. Because B. If C. Until D. Though
【单选题】
13.You can save money _______ you buy cheaper things.
A. before B. unless C. if D. until
【单选题】
14. We will have a _________ holiday after the exam.
A. two-month B. two month’s C. two month D. two-months
【单选题】
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
【单选题】
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
【单选题】
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
【单选题】
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
【单选题】
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
【单选题】
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
【单选题】
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
【单选题】
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
【单选题】
23. It was dark, ______ I couldnt see what was happening.
A. or B. though C. but D. so
【单选题】
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
【单选题】
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
【单选题】
( ) 26. Where does the writer of "The little Prince" come from?
A.England. B.France. C.America. D.China.
【单选题】
( ) 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
【单选题】
( ) 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
【单选题】
( ) 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.
【单选题】
( ) 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.
【单选题】
( ) 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.
【单选题】
( ) 32. What may be the proper Chinese for the underlined part in the passage?
A.闲暇时光 B.学费 C.精神空虚 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.
【单选题】
( ) 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
【单选题】
( ) 35. Who came up with the phrase according to the passage?
A. Judy Foreman. B. Natalie Smith. C. Anne Herbert D. Alice Johnson.
【单选题】
( ) 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.
【单选题】
( ) 37.The greatest river for navigation is ___________.
A. the Nile B. the Amazon C. the Mekong D. the Mississippi
【单选题】
( ) 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
【单选题】
( ) 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
【单选题】
( ) 40. The best title of the passage is ___________.
A. Rivers in Cities B. The importance of Rivers
C. Transportation D. Natural Resources