某加密程序的代码如下:
str1 = input("请输入明文:")
num = "1358821604"
str2 = " "
for ch in strl:
运行该程序,输入str1的值为“I-520-Python”,则输出结果为( )
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-Ravjqp | B.G-831-Nwrfml | C.I-251-Pwrfml | D.I-251-Pavjqp |
更新时间:2024-05-26 11:21:03
|
相似题推荐
选择题
|
适中
(0.65)
【推荐1】以下程序的输出结果是( )
a=1
if a>0:
a=1
if a>0:
a=a+1
else:a=a-1
print(a)A.0 | B.1 | C.2 | D.3 |
您最近一年使用:0次
选择题
|
适中
(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:
运行后若输入“3.803.93.520.888”(不包括引号),则输出的结果是( )
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.803 | B.93 | C.520 | D.888 |
您最近一年使用:0次
选择题
|
适中
(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.A | B.B | C.C | D.D |
您最近一年使用:0次
选择题
|
适中
(0.65)
【推荐1】为完善班级功能建设,班长设计并搭建了班级网站,(网站为:http://mo17733146-7.icoc.bz/),网站拥有成绩查询系统,同学们在登入网站后,输入自己的账号和密码就可以查询自己的成绩。查询成绩信息的部分代码如下:
@app.route("/col")
def chengji_list():
conn=sqlite3.connect("cj.db")
cur=conn.cursor()
cur.execute("select*from cjcx")
jieguo=cur.fetchall()
cur.close()
conn.close()
return render_template("list.html",jieguo=jieguo)
下列选项中说法正确的是( )
@app.route("/col")
def chengji_list():
conn=sqlite3.connect("cj.db")
cur=conn.cursor()
cur.execute("select*from cjcx")
jieguo=cur.fetchall()
cur.close()
conn.close()
return render_template("list.html",jieguo=jieguo)
下列选项中说法正确的是( )
A.查询的数据表名为cj.db |
B.连接的数据库文件名是cjcx |
C.当前视图函数是chengji_list() |
D.查询成绩信息时URL的地址为http://mo17733146-7.icoc.bz/ |
您最近一年使用:0次
选择题
|
适中
(0.65)
【推荐2】有如下 Python 程序段:
a=[2,2,6,1,8,5,3,6,4,3,6,4,9,5,3]
dic={}
for i in a:
a=[2,2,6,1,8,5,3,6,4,3,6,4,9,5,3]
dic={}
for i in a:
if i not in dic:
dic[i]=0
else:
dic[i]+=1
执行该程序段后,dic[3]的值为( )A.1 | B.2 | C.3 | D.4 |
您最近一年使用:0次