#NO.1
#celsius(摄氏温度),fahrenheit(华氏温度)
celsius =float(input(‘Enter a degree in Celsius :’))
fahrenheit = (9 / 5) * celsius +32
print(’%d Celsius is %.1f Fahrenheit’% (celsius,fahrenheit))
‘’’
‘’’
#NO.2
r,l = map(float,(input(‘Enter the radius and length of a cylinder:’).split()))
t = 3.14159
a = r * r * t
v = a * l
print(‘The area is %.4f’ %a)
print(‘The volume is %.1f’ %v)
‘’’
‘’’
#NO.3
y =float(input(‘Enter a value for feet:’))
m=y * 0.305
print(’%.1f feet is %.4f meters’%(y,m))
‘’’
‘’’
#NO.4
M = float(input(‘Enter the amount of water in kilogrms:’))
initi =float(input(‘Enter the initial temperatuer:’))
final =float(input(‘Enter the final temperatuer:’))
Q = M *(final - initi) * 4184
print(‘The energy needed is %.1f’ %Q)
‘’’
‘’’
#NO.5
ce,nll=map(float,(input(‘Enter balance and interest rate(e.g.,3 for 3%):’).split()))
lx=ce * (nll / 1200)
print(‘The interest is %.5f’ % lx)
‘’’
‘’’
#NO.6
v0,v1,t =map(float,(input(‘Enter v0,v1,and t:’).split()))
a=(v1-v0)/t
print(‘The average acceleration is %.4f’ %a)
‘’’
‘’’
#NO.7
qian = int(input(‘Enter the monthly saving amount:’))
a=0
for i in range(6):
a=(qian +a )*(1+0.00417)
print(‘After the sixth month,the account value is %.2f’ %a)
‘’’
‘’’
#NO.8
shu = int(input(‘Enter a number between 0 and 1000:’))
a=shu//100
b=(shu//10)%10
c=shu%10
print(‘The sum of the digits is %d’ %(a+b+c))
‘’’
‘’’
#NO.9 25/4
a=25/4
print(int(a))
#或
b=25//4
print(b)
‘’’
‘’’
#NO.10
a=int(input(‘输入一个数’))
if (a%2==0):
print(‘偶数’)
else:
print(‘奇数’)
‘’’
‘’’
#NO.11
a= int(input(‘输入秒数’))
fen=a/60
miao=a%60
print(’%d 分’ %fen,’%d 秒’%miao)
‘’’
‘’’
#NO.12
a=int(input(‘请输入:’))
b=6
day=(b+a)%7
if(day==0):
print(‘星期日’)
else :
print(‘星期%d’% day)
‘’’