Answer to Question #187011 in Python for dhrs

Question #187011

) 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.


1
Expert's answer
2021-04-29T12:10:01-0400
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))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS