Question 2: If Else

Write a Python program to find out if a child has collected enough balloons for a party.

  1. Start by asking for the child’s name and store it in a variable called name.
  2. Ask how many red balloons they have and store it in a variable called red_balloons (as an integer).
  3. Ask how many blue balloons they have and store it in a variable called blue_balloons (as an integer).
  4. Ask how many yellow balloons they have and store it in a variable called yellow_balloons (as an integer).
  5. Calculate the total number of balloons by adding red_balloons, blue_balloons, and yellow_balloons and store it in a variable called total_balloons.
  6. Use an if-else condition to check:
    • If the total number of balloons is 30 or more, print:
      “Great job, [name]! You have [total_balloons] balloons, enough for the party!”
    • Otherwise, print:
      “Oh no, [name]! You only have [total_balloons] balloons. You need more for the party!”
Write what you are looking for, and press enter to begin your search!