19vitkauskasd 19vitkauskasd
  • 17-01-2022
  • Computers and Technology
contestada

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

any1 know anything wrong with this code? (python)

Respuesta :

tonb
tonb tonb
  • 17-01-2022

Answer:

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

weightMoon = weightEarth/6

print("Weight on moon:", weightMoon)

Explanation:

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

Answer Link

Otras preguntas

Which of the following was a technological achievement of the ancient Romans which improved transportation for them?
I need both of these answered fast please.​
A rocket moves straight upward , starting from rest with an acceleration of 29.4 m/s2. it runs out of fuel at the end of 4.00 s and countinues to coast upward ,
What is healthy eating?
The staff nurse is a member of the disaster planning committee at a local hospital and will give a presentation to the community regarding the need for voluntee
What is the slope of the line that passes through the points (10,2) and (19,14)
What is a water Cherenkov tank?
Can you show me the steps to factor out 8x^3 - 27y^3?
A(n) ________ is defined as a research design that includes independent and dependent variables and random assignment of participants to control and experimenta
Dr. Martin Luther King had a dream that all peolle ciuld live in peace together. Write 3 paragraphs how you can make this world a more peaceful place to live in