发布于2019-07-16 19:42 阅读(5071) 评论(0) 点赞(4) 收藏(91)
出处:http://my.oschina.net/u/1433482/blog/467954?fromerr=WrfxL2Kw
试卷时间 60分钟,请不要在试卷上作答,用A4纸做答题纸作答。
A、x = y = z = 1 B、x = (y = z + 1)
C、x, y = y, x D、x += y
A、变量不必事先声明 B、变量无须先创建和赋值而直接使用
C、变量无须指定类型 D、可以使用del释放资源
A、int32 B、40XL C、self D、name
A、除字典类型外,所有标准对象均可以用于布尔测试
B、空字符串的布尔值是False
C、空列表对象的布尔值是False
D、值为0的任何数字对象的布尔值是False
A、5+4j > 2-3j B、3>2>2
C、(3,2) ‘xyz’
A、char B、int C、float D、list
A、表示复数的语法是real + image j B、实部和虚部都是浮点数
C、虚部必须后缀j,且必须是小写 D、方法conjugate返回复数的共轭复数
A、字符应该视为长度为1的字符串 B、字符串以标志字符串的结束
C、既可以用单引号,也可以用双引号创建字符串 D、在三引号字符串中可以包含换行回车等特殊字符
A、dict1 = {} B、dict2 = { 3 : 5 } C、dict3 = {[1,2,3]: “uestc”} D、dict4 = {(1,2,3): “uestc”}
A、min = x if x y ? x : y
C、if (x > y) print x D、while True : pass
print type(1/2)
A. B. C. D. E.
1
2
|
nums = set([1,1,2,3,3,3,4])
print len(nums)
|
A.1 B.2 C.4 D.5 E.7
1
2
3
4
5
6
7
8
9
10
11
12
|
counter = 1
def doLotsOfStuff():
global counter
for i in (1, 2, 3):
counter += 1
doLotsOfStuff()
print counter
|
A.1 B.3 C.4 D.7 E.none of the above
1
|
print r"nwoow"
|
A.new line then the string: woow
B.the text exactly like this: r”nwoow”
C.the text like exactly like this: nwoow
D.the letter r and then newline then the text: woow
E.the letter r then the text like this: nwoow
1
2
3
4
5
|
for i in range(2):
print i
for i in range(4,6):
print i
|
A.2, 4, 6 B.0, 1, 2, 4, 5, 6 C.0, 1, 4, 5 D.0, 1, 4, 5, 6, 7, 8, 9 E.1, 2, 4, 5, 6
1
2
3
|
import math
print math.floor(5.5)
|
A.5 B.5.0 C.5.5 D.6 E.6.0
and the program is run as: python /usr/lib/python/person.py
What gets printed?()
1
2
3
4
5
6
7
8
|
class Person:
def __init__(self):
pass
def getAge(self):
print __name__
p = Person()p.getAge()
|
A.Person B.getAge C.usr.lib.python.person D.main E.An exception is thrown
1
2
3
4
5
6
|
names1 = ['Amir', 'Barry', 'Chales', 'Dao']
if 'amir' in names1:
print 1
else:
print 2
|
A.1 B.2 C.An exception is thrown
1
2
3
4
5
|
numbers = [1, 2, 3, 4]
numbers.append([5,6,7,8])
print len(numbers)
|
A.4 B.5 C.8 D.12 E.An exception is thrown
1
2
3
4
5
6
7
|
kvps = { '1' : 1, '2' : 2 }
theCopy = kvps.copy()
kvps['1'] = 5
sum = kvps['1'] + theCopy['1']
print sum
|
A.1 B.2 C.6 D.10 E.An exception is thrown
文件如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# cat /etc/passwdroot:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
usbmuxd:x:113:113:usbmuxd user:/:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
rpc:x:32:32:Rpcbind Daemon:/var/cache/rpcbind:/sbin/nologin
rtkit:x:499:497:RealtimeKit:/proc:/sbin/nologin
avahi-autoipd:x:170:170:Avahi IPv4LL Stack:/var/lib/avahi-autoipd:/sbin/nologin
abrt:x:173:173::/etc/abrt:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
gdm:x:42:42::/var/lib/gdm:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
apache:x:48:48:Apache:/var/www:/sbin/nologin
saslauth:x:498:76:"Saslauthd user":/var/empty/saslauth:/sbin/nologin
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
pulse:x:497:496:PulseAudio System Daemon:/var/run/pulse:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
tcpdump:x:72:72::/:/sbin/nologin
neil:x:500:500::/home/neil:/bin/bashtest:x:501:501::/home/test:/bin/bash
yulian:x:503:503::/home/yulian:/bin/bash
puppet:x:52:52:Puppet:/var/lib/puppet:/sbin/nologin
jboss:x:504:504::/home/jboss:/bin/bash
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
release:x:505:505::/home/release:/bin/bash
redis:x:496:493:Redis Server:/var/lib/redis:/sbin/nologin
mongodb:x:184:492:MongoDB Database Server:/var/lib/mongodb:/sbin/nologin
fang:x:506:506::/home/fang:/bin/bash
roundup:x:495:491:Roundup Issue Tracker:/var/lib/roundup:/sbin/nologin
exim:x:93:93::/var/spool/exim:/sbin/nologin
dial:x:507:507::/home/dial:/bin/bash
share:x:508:508::/home/share:/bin/bash
|
请打印出用户目录在/home下面的的用户目录,如下
1
2
3
4
5
6
7
8
|
/home/neil
/home/test
/home/yulian
/home/jboss
/home/release
/home/fang
/home/dial
/home/share
|
建议一行搞定。
用一条SQL语句 查询出每门课都大于80分的学生姓名 。表scores如下:
name kecheng fenshu
张三 语文 81
张三 数学 75
李四 语文 76
作者:today
链接:https://www.pythonheidong.com/blog/article/1693/584bdfd6b22b6ae7889f/
来源:python黑洞网
任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任
昵称:
评论内容:(最多支持255个字符)
---无人问津也好,技不如人也罢,你都要试着安静下来,去做自己该做的事,而不是让内心的烦躁、焦虑,坏掉你本来就不多的热情和定力
Copyright © 2018-2021 python黑洞网 All Rights Reserved 版权所有,并保留所有权利。 京ICP备18063182号-1
投诉与举报,广告合作请联系vgs_info@163.com或QQ3083709327
免责声明:网站文章均由用户上传,仅供读者学习交流使用,禁止用做商业用途。若文章涉及色情,反动,侵权等违法信息,请向我们举报,一经核实我们会立即删除!