python求直角边和3位数逆序

1.求直角边

import math
a=float(input("请输入直角边1的长度:"))
b=float(input("清输入直角边2的长度:"))
c=math.sqrt(a*a+b*b)
print("斜边长为:",c)

2.整数3位数逆序

A=int(input('请输入一个三位数'))
a=A/100
b=A//10%10
c=A%10
number=c*100+b*10+a
print('%d的反转数是:%d'%(A,number))

猜你喜欢

转载自blog.csdn.net/qq_50777680/article/details/121029771