+ 1

y it's not working

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() this code suppose to ask for input and work according to that but it doesn't, i ' m curious to know where m i wrong

27th Nov 2017, 8:45 AM
AppInventor
AppInventor - avatar
5 Answers
+ 9
answer = int(input("i wanna know")) thats userinput in python
27th Nov 2017, 11:13 AM
Oma Falk
Oma Falk - avatar
+ 7
please show program in code playground
27th Nov 2017, 9:31 AM
Oma Falk
Oma Falk - avatar
0
k
27th Nov 2017, 10:26 AM
AppInventor
AppInventor - avatar
27th Nov 2017, 10:29 AM
AppInventor
AppInventor - avatar
0
added changed code to comments in your code
27th Nov 2017, 3:26 PM
Pavan Kumar T S
Pavan Kumar T S - avatar