Question 6: Variables

Write a Python program to display information about a planet in the solar system.

  1. Create a variable called planet_name and assign it the name of a planet (e.g., "Mars").
  2. Create a variable called distance_from_sun and assign it the distance of the planet from the Sun in million kilometers (e.g., 228).
  3. Create a variable called number_of_moons and assign it the number of moons the planet has (e.g., 2).
  4. Create a variable called fun_fact and assign it a fun fact about the planet (e.g., "Mars is also known as the Red Planet!").
  5. Use the print function to display the following:
    • The planet’s name: "The planet I chose is [planet_name]."
    • Its distance from the Sun: "It is [distance_from_sun] million kilometers away from the Sun."
    • The number of moons: "It has [number_of_moons] moons."
    • A fun fact: "Did you know? [fun_fact]"
Write what you are looking for, and press enter to begin your search!