x=int(input(“输入x”))
y=int(input(“输入y”))
r=x%y
while r!= 0:
x,y=y,r
r=x%y
print(y)
(2+2==4)and(not(2+2)==5)
print(ord(65+i),end=",")
B . for i in [1,2,3]:print(chr(65+i),end=",")
C . i = 0while i < 3:
print(chr(i+65), end= “,”)
i += 1
continue
D . i = 0while i < 3:
print(ord(i+65),end= “,”)
i += 1
a=[3,7,2,5,8,9,4,6,1]
m, c=1, 1
for i in range(1,len(a)):
if a[i]>=a[i-1]:
c+=1
m=max(m, c)
else:
c=1
程序执行后,c和m的值分别是( )
x=4095
s1="ABCDEFGHIJ"
s2="abcdefghij"
ret=""
while x>0:
r=x % 10
if r % 2==1:
ret=s1[r]+ret
else:
ret=ret+s2[r]
x=x//10
print(ret)
图b
import math
def ss(n):
Flag=True
i=2
while i <= int(math.sqrt(n))and Flag:
if
Flag = False
return Flag
n=int(input(“输入一个大于2的偶数”))
for i in rang(2,n//2+1):
if
print(str(n)+"="+str(i)+"+"+str(n-i))
如果输入“8”则结果显示
day=input("请输入年月日(格式举例:2000-01-05):")
year=int(day[:4])
month= ①
sun=int(day[8:10])
print(year,month,sun)
f_run=[31,28,31,30,31,30,31,31,30,31,30,31]
tall_day=0
if ② :
for i in range(month-1):
tall_day +=f_run[i]
③
else:
for i in range(month-1):
tall_day +=f_run[i]
tall_day += sun
print(day+"是当年的第"+str(tall_day)+"天")
① ② ③
def convert(s):
m=0
le=len(s)
key=s[le-1]
if key=="B":
n=2
elif key=="D":
①
else:
n=16
i=0
while i<=le-2:
c=s[le-1-i]
if c>="0"and c<="9":
a=ord(c)-ord("0")
elif c>="A"and c<="F":
a=ord(c)-ord("A")+10
②
i+=1
return m
s=input("请输入算式")
result=0;suanfu1="";suanfu2="";s1=""
for i in range(len(s)):
c=s[i]
if c=="+" or c=="-" or c=="=":
③
suanfu1=suanfu2
suanfu2=c
if suanfu1=="":
result=t
if suanfu1=="+":
result=result+t
if suanfu1=="-":
result=result-t
s1=""
else:
s1=s1+c
print("计算结果为"+str(result)+"D")
① ② ③