n=int(input("请输入十进制数:"))
Hex=["A","B","C","D","E","F"]
s=""
while n!=0:
r=n%16
if r>=10:
s=str(r)+s
print("十六进制数为:",s)
s=input("请输入一串整数,以逗号间隔开来:")
t=""
sum=0
for i in ① :
if i!=", ":
②
else:
sum=sum+int(t)
print("该数据序列的和为:",sum)
① ②
1 图
2 图
3 图
b = [0,0,0,0,
0,0,0,0,
0,0,0,0 ] # 表示 4×4 方阵
time = input("输入时间(例:08:25 输入 0825):")
for i in range(len(time)):
n =
r2 = ""
for j in range(4): # 将数字转为 4 位二进制
r2 =
n //= 2
for j in range(len(r2)):
if r2[j] == "1":
b[j * 4 + i] = 1
s = ""
print(time, "模拟结果:")
for i in range(len(b)):
s += str(b[i]) + " "
if :
print(s)
a=[1,1]
n=int(input("请输入位数n="))
for i in range(2,n) :
t=
a.append(t) #a.append(t)函数的功能是在列表a末尾添加元素t的值
print("该项数上的值为:",a[])