193k views
9 votes
Print("Weight on Earth?")

weightEarth = input()
weightMoon = (weightEarth/6)
print("Weight on moon:", weightMoon)

any1 know anything wrong with this code? (python)

User Memedon
by
8.1k points

1 Answer

5 votes

Answer:

weightEarth = float(input("Enter weight on earth: "))

weightMoon = weightEarth/6

print("Weight on moon:", weightMoon)

Step-by-step explanation:

You have to convert the string input into a float in order to do calculations with it.

User Baztoune
by
8.5k points

Related questions

1 answer
4 votes
96.7k views
1 answer
3 votes
116k views
asked Dec 14, 2024 84.4k views
Jerome Provensal asked Dec 14, 2024
by Jerome Provensal
8.2k points
1 answer
4 votes
84.4k views