Feb-28-2021, 12:49 PM
This is what I am asked to do :
Five Star Retro Video rents VHS tapes and DVDs to the same connoisseurs who like to buy LP record albums. The store rents new videos for $3.00 a night, and oldies for $2.00 a night.
Write a program that the clerks at Five Star Retro Video can use to calculate the total charge for a customer’s video rentals.
The program should prompt the user for the number of each type of video and output the total cost.
An example of the program input and output is shown below:
Enter the number of new videos: 3
Enter the number of oldies: 2
The total cost is $13.0
And this is my code :
import math
a = eval input("Please enter the number of your new videos ")
b = eval input("Please enter the number of your oldies")
w = (a*3)
z = (b*2)
The total cost is = print(w+z)
And this is what I got :
File "fivestar.py", line 1
import math
^
IndentationError: unexpected indent
File "fivestar.py", line 2
a = eval input("Please enter the number of your new videos ")
^
SyntaxError: invalid syntax
File "fivestar.py", line 6
The total cost is = print(w+z)
^
SyntaxError: invalid syntax
I will be grateful for your help
Five Star Retro Video rents VHS tapes and DVDs to the same connoisseurs who like to buy LP record albums. The store rents new videos for $3.00 a night, and oldies for $2.00 a night.
Write a program that the clerks at Five Star Retro Video can use to calculate the total charge for a customer’s video rentals.
The program should prompt the user for the number of each type of video and output the total cost.
An example of the program input and output is shown below:
Enter the number of new videos: 3
Enter the number of oldies: 2
The total cost is $13.0
And this is my code :
import math
a = eval input("Please enter the number of your new videos ")
b = eval input("Please enter the number of your oldies")
w = (a*3)
z = (b*2)
The total cost is = print(w+z)
And this is what I got :
File "fivestar.py", line 1
import math
^
IndentationError: unexpected indent
File "fivestar.py", line 2
a = eval input("Please enter the number of your new videos ")
^
SyntaxError: invalid syntax
File "fivestar.py", line 6
The total cost is = print(w+z)
^
SyntaxError: invalid syntax
I will be grateful for your help
