) Create a program that ask user to input their weight. Imagine that the user was standing on the moon right now, his/her weight would be 16.5 percent of what it is on Earth. If he/she gained a kilo in weight every year for the next 15 years, what would his/her weight be for each year of the 15 years? Write a program using a for loop that prints the user moon weight for each year.
weight = int(input('Enter your weight: '))
moon_weight = lambda x:x*16.5/100
print('Your weight on the moon will be: ',moon_weight(weight))
weight_add = int(input('Enter weight addition for the year: '))
for i in range(15):
weight += weight_add
print(f'Your weight on the moon in {i+1} years will be:',
moon_weight(weight))
Comments
Leave a comment