repl.it
@Nanashi/

Spaceweight Calculator v2

Python

Shows your weight on different objects in the Solar system. Forked from https://repl.it/talk/share/Spaceweight-Calculator/9875

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Spaceweight Calculator v2
# Stolen from repl.it user potatosmurfer and refactored
import replit

# G's relative to Earth
gravities = [("the Sun", 28.02),
  ("Mercury", 0.377),
  ("Venus", 0.904),
  ("Moon", 0.165),
  ("Mars", 0.379),
  ("Jupiter", 2.53),
  ("Saturn", 1.065),
  ("Uranus", 0.89),
  ("Neptune", 1.14),
  ("Pluto", 0.063)]

while True:
  replit.clear()
  weight = float(input("What is your weight on Earth (in kg)?: "))
  for item in gravities:
    print("Your weight on {0}: {1:.2f} kg".format(item[0], weight * item[1]))
  r = input("\nPress enter to restart.")