Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created May 20, 2023 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/129cbc396705effc15236e7f8b978a33 to your computer and use it in GitHub Desktop.
Save codecademydev/129cbc396705effc15236e7f8b978a33 to your computer and use it in GitHub Desktop.
Codecademy export
print("I have information for the following planets:\n")
print(" 1. Venus 2. Mars 3. Jupiter")
print(" 4. Saturn 5. Uranus 6. Neptune\n")
weight = 185
planet = 3
#planets written below
planet_1 = 'Venus'
planet_2 = 'Mars'
planet_3 = 'Jupiter'
planet_4 = 'Saturn'
planet_5 = 'Uranus'
planet_6 = 'Neptune'
#weights written below
planet_1_gravity = 0.91
planet_2_gravity = 0.38
planet_3_gravity = 2.34
planet_4_gravity = 1.06
planet_5_gravity = 0.92
planet_6_gravity = 1.19
# Write an if statement below:
if planet == 1:
print("You're on the planet: " +planet_1+ ". Here Codey's weight is: " + weight*planet_1_gravity)
elif planet == 2:
print("You're on the planet: " +planet_2+ ". Here Codey's weight is: " + weight*planet_2_gravity
elif planet == 3:
print("You're on the planet: " +planet_3+ ". Here Codey's weight is: " + weight*planet_3_gravity
elif planet == 4:
print("You're on the planet: " +planet_4+ ". Here Codey's weight is: " + weight*planet_4_gravity
elif planet == 5:
print("You're on the planet: " +planet_5+ ". Here Codey's weight is: " + weight*planet_5_gravity
elif planet == 6:
print("You're on the planet: " +planet_6+ ". Here Codey's weight is: " + weight*planet_6_gravity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment