Question 13: Input Pencils

Write a Python program to find out how many pencils a child has in total.

  • Start by asking for the child’s name and store it in a variable called name.

  • Ask how many boxes of pencils they have and store it in a variable called boxes (as an integer).

  • Ask how many pencils are in each box and store it in a variable called pencils_per_box (as an integer).

  • Multiply boxes by pencils_per_box and store the result in a variable called total_pencils.

  • Print a friendly message that includes the child’s name and the total number of pencils they have, like this:
    “Hi [name]! You have a total of [total_pencils] pencils.”

Write what you are looking for, and press enter to begin your search!