文档介绍:-2020AsposePtyLtd.
?(rint"no"
Whatgetsprinted?(C)x=True
y=Falsez=False
ifnotxory:
print1
elifnotxornotyandz:
print2
-2020AsposePtyLtd.
elifnotxoryornotyandx:
print3
else:
print4
IfPYTHONPATHissetintheenvironment,whichdirectoriesaresearchedformodules?(D)
PYTHONPATHdirectory
currentdirectory
homedirectory
installationdependentdefaultpath
only
,B,,B,,B,C,andD
,thecodewillprinterrortype1ifaccessSecureSystemraisesanexceptionofeitherAccessErrortypeorSecurityErrortype(B)
try:
accessSecureSystem( )
exceptAccessError,SecurityError:
print"errortype1"
continueWork( )
(B)
daysOfWeek=['Monday',
'Tuesday',
-2020AsposePtyLtd.
'Wednesday',
'Thursday',
'Friday',
'Saturday',
'Sunday']
months= ['Jan',\
'Feb',\
'Mar',\
'Apr',\
'May',\
'Jun',\
'Jul',\
'Aug',\
'Sep',\
'Oct',\
'Nov',\
'Dec']
print"DAYS:%s,MONTHS%s"%
(daysOfWeek,months)
?(A)
f=None
foriinrange(5):
withopen("","w")asf:
ifi>2:
break
?(C)
counter=1
-2020AsposePtyLtd.
defdoLotsOfStuff( ):
globalcounter
foriin(1,2,3):
counter+=1
doLotsOfStuff( )
printcounter
Whatgetsprinted?(C)printr"\nwoow"