Basketball bounce

Basketball bounce

Basketball falling down from a certain height, the height of each bounce, one half the height of the front is. Once again fall and bounce very first bounce. The initial hypothesis basketball height of 10 meters.

Please use the program
the number of input basketball bouncing num, where the height of the basketball after computing num times, and outputs the calculation result.

# 请使用 input() 输入弹跳的次数 num
num = int(input('请输入弹跳的次数: '))
height=10
# 请计算弹跳 num 次后的篮球高度,并将结果输出
for i in range(num):
    height=height/2
print(height)
Published 74 original articles · won praise 25 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_43191251/article/details/104344018