Latest web development tutorials

Pythonは演習20を含みます

Pythonの100リー Pythonの100リー

タイトル:各着陸抗ジャンプ元の高さ後半後の100メートルの高さからボール自由落下、;ダウン再び、何メートルの合計後、10階でそれを見つけますか? 第十リバウンド背の高いですか?

プログラム解析:なし

ソースコード:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

Sn = 100.0
Hn = Sn / 2

for n in range(2,11):
    Sn += 2 * Hn
    Hn /= 2

print 'Total of road is %f' % Sn
print 'The tenth is %f meter' % Hn

上の例の出力は、次のとおりです。

Total of road is 299.609375
The tenth is 0.097656 meter

Pythonの100リー Pythonの100リー