下面说法正确的是( )
d={"A":1,"B":2,"C":3,"D":4,"E":5}
a=d["E"]
b=d["D"]
c=d["B"]
s=a+b+c
print(s)
程序运行后,输出的结果是( )
s= "ZHEJIANGSHENG"
p= "HANGZHOUSHI”
if len(s)>len(p) :
s,p=p,s
x=len(p)-len(s) .
if x<3:
y=s[1:6:x] .
else:
y=s[0:x]
print (y)
程序运行后,变量y的值是( )
def gcd(a,b):
c=a%b
while c > 0:
a,b =b,c
c=a%b
return b
a=int (input("请输入: "))
b=int (input("请输入: "))
gcd = gcd(a, b)
scm=a*b//gcd
print( gcd, scm)
运行该程序,输入a,b的值分别为16,12,则输出gcd,scm的值分别为( )
s1=input("请输入: ")
q=" 1357902468" ;s2="”
for ch in sl:
if "0"<=ch<="9" :
s2+=q[int (ch)]
elif "a"<=ch<="z”:
s2+=chr((ord(ch) -ord(" a") +2)%26+ord("a"))
else:
s2+=ch
print (s2)
运行该程序,输入s1的值为“Mike122@qq.com”,则s2的值为( )
info=[19,25,10,5,7,21,9,15]
x=max (info)
y=min(info)
z=len(info)
r=info[-5]
s=(x-y)%(z-r)
print (s)
运行程序后,输出的结果是
list1=[2,3,4,5,6]
m1=1
m2=2
for n in list1:
if n%3==0:
m1*=n
print (m1-m2)
程序运行后,输出的结果为
import random
a=random.randint (0, 100)
chance=5
print("共%d次机会"% (chance))
for i in
b=int (input("请输入一个整数: "))
if a<b:
print("大啦!!!还剩%d次机会"% (chance-i))
elif a>b:
print("小啦!!!还剩%d次机会"% (chance-i))
else:
print("恭喜您,答对啦!!!数字是%d,共用次数%d"%(a, i))
Break
importmath
total=float(input("请输入金额:"))
if total<=500:
total*=0.9
elif total<=1500:
total*=0.85
else
total*=0.75
print(math.floor(total))
运行程序,输入“1024”后回车,程序的输出结果是
number=int (input(“请输入一个四位数:”))
a = number// 1000
b=
c = number%100//10
d = number%10
if
print (number,“ 是四叶玫瑰数”)
else:
print (number,“不是四叶玫瑰数” )
请输入各门功课的学考等级: ABABACBAAA |
你的学考成绩折算为: 94 |
level=input (”请输入各门功课的学考等级: ")
dic={"A":10,"B":9,"C":7,"D":4}
score=0
for i in range(len(level)):
score = score +
print("你的学考成绩折算为:"+ )