Question 2: Variables

Write a Python program to display information about a car and its fuel efficiency.

  1. Create a variable called car_model and assign it a car model name (e.g., "Toyota Corolla").
  2. Create a variable called year and assign it the manufacturing year of the car (e.g., 2022).
  3. Create a variable called mileage and assign it the car’s mileage in miles per gallon (e.g., 35).
  4. Create a variable called fuel_tank_capacity and assign it the fuel tank capacity in gallons (e.g., 13).
  5. Use the print function to display the following:
    • The car model and year: "The car is a [year] [car_model]."
    • The car’s fuel efficiency: "It has a mileage of [mileage] miles per gallon."
    • The car’s fuel tank capacity: "The fuel tank can hold up to [fuel_tank_capacity] gallons of fuel."
Write what you are looking for, and press enter to begin your search!