组卷网 > 高中信息技术综合库 > 数据与计算 > 算法与程序实现 > 程序设计 > 分支结构的程序实现
题型:选择题 难度:0.65 引用次数:15 题号:22956341
某加密程序的代码如下:
str1 = input("请输入明文:")
num = "1358821604"
str2 = " "
for ch in strl:

if "0" <= ch <= "9":

str2 += num[int(ch)]

elif "a" <= ch <= "z":

str2 += chr((ord(ch) - ord("a") + 2) % 26 + ord("a"))

else:

str2 += ch

print(str2)
运行该程序,输入str1的值为“I-520-Python”,则输出结果为(       
A.G-831-RavjqpB.G-831-NwrfmlC.I-251-PwrfmlD.I-251-Pavjqp

相似题推荐

选择题 | 适中 (0.65)
【推荐1】以下程序的输出结果是(     
a=1
if   a>0:

a=a+1

else:

a=a-1

print(a)
A.0 B.1C.2D.3
2023-07-14更新 | 64次组卷
选择题 | 适中 (0.65)
【推荐2】有如下Python程序段:
a=b=""
k=0
s=input().strip()
for i in range(len(s)):
       if "0"<=s[i]<="9":
             k+=1
       else:
             b=s[i-k:i]
       if a < b:

a=b

k=0

print(a)
运行后若输入“3.803.93.520.888”(不包括引号),则输出的结果是(     
A.803B.93C.520D.888
2024-06-15更新 | 3次组卷
选择题 | 适中 (0.65)
【推荐3】如图所示,温岭新天地的“我在温岭很想你”成了网红打卡地。

规定字符串s的长度等于7时,被称为“超想你”;否则被称为“很想你”,例如“我在温岭很想你”字符串的长度为7,所以被称为“超想你”,在下面Python程序中,表达符合题意的是(     
A.
a=len(s)
if a==7:
       print("超想你")
else:
       print("很想你")
B.
a=len(s)
if a%7==0 and a>0:
       print("超想你")
else:
       print("很想你")
C.
a=len(s)
if a%7!==0 or a==0:
       print("很想你")
else:
       print("很想你")
D.
a=len(s)
b=[]*a
for i in rang(a):
       b[i]=i
if b[6]==7
       print("很想你")
else:
       print("很想你")
A.AB.BC.CD.D
2024-06-12更新 | 5次组卷
共计 平均难度:一般