PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# this is my very first functional program with Python
# hope you like it
# this will calculate u the amount of weight each year you will maintain on moon
#let's get to business
import sys
def moon_weight():
print('Please enter your current Eearth weight')
weight = float(sys.stdin.readline())
print('Now enter the amount u might increase each year')
increase = float(sys.stdin.readline())
print('ThankYou, only one more thing, enter the number of years')
years = int(sys.stdin.readline())
years = years + 1
for year in range(1, years)
weight = weight + increase
moon_weight = weight * 0.165
print ('Year %s is %s' % (year, moon_weight))
moon_weight()
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run