Please help!


#1

Hey! I’m currently, trying to create a code but as I do this, I’m receiving a Syntax Error. Could someone check if I had done something wrong! And below the print (“Please come again!”) I wanna make it so that it End the entire thing.

import random
Starting_Fuel = random.randint (0,50)
Full_Tank = 50
Unleaded_Petrol = 1.11
Super_Unleaded_Petrol = 1.21
Diesel = 1.15
Diesel_Premium = 1.25


print ("Welcome to the Staffless Petrol Works")
print ("A - Unleaded Petrol - " +str(Unleaded_Petrol)+  " per litre")
print ("B - Super Unleaded Petrol - "  +str(Super_Unleaded_Petrol)+  " per litre")
print ("C - Diesel - "  +str(Diesel)+  " per litre")
print ("D - Diesel Premium - "  +str(Diesel_Premium)+  " per litre")

print ("You have " + str(Starting_Fuel) +" litres of fuel remaining in your tank.")

print ("Would you like to fill it up? ")

Yes_No = input("Y or N")
if Yes_No == ("N"):
	   fuel_type = input("Which fuel do you require?")
elif str(Yes_No) == ("N"):
	print ("Please come again!")    
    

fuel_type = input("Which fuel do you require? A, B, C, D")
print ("You have chosen " + fuel_type)

Litres_Required = input("Please pick between 0 to 50 litres")
print ("You have chosen "  +str(Litres_Required)+ " Litres")
if fuel_type == "A":
    price = str(Unleaded_Petrol *str(Litres_Required)
elif fuel_type = "B":                               
    price = str(Super_Unleaded_Petrol*str(Litres_Required)
                                
elif fuel_type == "C"
    price = str(Diesel*str(Litres_Required)
                                
elif fuel_type == "D":
    price = str(Diesel_Premium)*str(Litres_Required)

print ("Fuel Choice" + fuel_type)
print ("Quantity"  +Litres_Required+  "Litres")
print ("Total cost: £"  +price)

#2

look at the line above the error message line, pay close attention to your parentheses

i can also highly recommend this:

https://pyformat.info/

and multi-line string instead of all those single print statements: