48.8k views
1 vote
Write a program to ask the user how many apples they are buying, and then output the total cost of the apples.

User Limfinity
by
7.7k points

1 Answer

3 votes

In python:

apple_price = (whatever price you choose)

apple_quantity = int(input("How many apples are you buying? "))

print(f"The total cost of {apple_quantity} apple(s) is ${apple_quantity * apple_price}")

User Ryan Erwin
by
8.3k points

No related questions found