1. 输出30°的正弦和余弦。
2. 输入语文、数学、英语成绩,输出总分和平均分。
3. 输入球的半径,输出球的体积,结果保留1位小数。
4. 输出一个大写字母,输出对应的小写字母。
--------------------------------------------------------------------------
--------------------------------------------------------------------------
--------------------------------------------------------------------------
1
import math
print(f'sin of 30°: {math.sin(math.radians(30))}')
print(f'cos of 30°: {math.cos(math.radians(30))}')
2
chinese = float(input('input Chinese: '))
maths = float(input('input Maths: '))
english = float(input('input English: '))
scores = (chinese, maths, english)
print(f'Sum: {sum(scores)}')
print(f'Average: {sum(scores) / len(scores)}')
3
import math
r = float(input(f'Input radius: '))
print(f'Volume: {round((4 / 3 * math.pi * r ** 3), 1)}')
4
upper = input('Input a capital letter: ')
print(f'Lower case: {upper.lower()}')