p ="Tel-114"
c=""
for ch in p:
if ch>= "0" and ch<= "9":
c+=str(9-int(ch))
elif ch>= "a" and ch<= "z":
ch= chr(ord(ch) - 32)
if ch>= "A" and ch<= "Z":
c=ch+c
print(c)
执行程序后,输出的结果为( )
m = int(input("请输入内存容量:"))
s = input("请输入英语句子:")
dic = {}
head = tail = 0
word = ""
for ch in s:
if ch == " " or ch == "," or ch == ".":
if word not in dic or dic[word] < head:
if tail - head == m:
dic[word] = tail
tail + = 1
word = ""
else:
if :
ch = chr(ord(ch) + 32)
word += ch
print("需要去外存查找",,"次词典")
图 a | 图 b |
请回答下列问题:
f=open(" ",encoding="utf-8")
line=f.readline() #读取第一行,保存在字符串 line 中
pro,pub=0,0
while line:#当 line 非空
x=
t=int(line[3:])
if x=="A":
pro+=t
elif x=="B":
line=f.readline() # 继续读取一行
score=int(pro/5*0.6+pub/5*0.4)
grade=
print("推荐度为:","★"*grade)
def p(x):
for i in range(2,x):
if x%i==0:
return False
return True
执行语句 print(p(5),p(6))后,输出的结果为( )
while True:
t=pin0.read_analog()
if t>40:
display.show(Image.HAPPY)#在 LED 屏上点阵显示笑脸的图形
sleep(2000)
else:
display.show(Image.SAD)#在 LED 屏上点阵显示哭脸的图形
sleep(1000)
将代码烧录至某智能终端后运行,下列关于代码执行效果描述不正确的是( )