Skip to content
Advertisement

How can I find the sum of a users input?

JavaScript

Above is a code I have so far. It prints:

JavaScript

My goal is for the code to add up the two services and make a total price. My end goal should look like this:

JavaScript

Notice how the code added both prices and made a “Total.” Is there any way I can do this? I’m a beginner computer science major, so we aren’t too far into Python.

ALL CODE IS IN PYTHON

Advertisement

Answer

Use dictionary –

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement