An interactive introduction to programming in Python, for human beings and whoever else
When you’re in space, at least two things are true:
Your weight on different planets1 depends on the surface gravity of that planet. According to the surface gravity page on Wikipedia, the Earth has a surface gravity of 1g, while the Moon has a surface gravity of 0.1654g. This means if something weighs 100kg on the Earth, it would weigh 16.54kg on the Moon.
These facts are important because you bet your friend $20 that you’re strong enough to pick him up, all the way over your head. He never said it had to happen on Earth, though!
If your friend weighs 80kg on Earth, how much does he weigh on other planets? Once you know, you can take a quick trip into space and win twenty bucks from him.
For each planet, print the name of the planet and how much your friend weighs on that planet. Also, please use the
round function to round to two decimal points. For example, if you wanted to round
3.3333 to two decimal points, you’d do
round(3.3333, 2) and it would give you
By the way, these locations were picked because of NASA’s super-cool Visions of the Future travel posters.
weight = 80
print("Words words", 30, "more words")
0.1654gand Earth has a surface gravity of
1g, we can convert from Earth weight to Moon weight by multiplying the Earth weight by
round(weight * 0.1654, 2)would give us a rounded weight on the moon
print("On Venus he weighs", round(weight * 0.904, 2)). If that seems too complicated, we can also save
round(weight * 0.904, 2)into its own variable and have the
 Planet or other body in space. Moons are cool, dwarf planets are cool, planets from far away are cool. I don’t want to hear you complaining.