0
Big problem with this code everything give me error could you helpme
Take the number of available spaces as an input spaces=int(input()) # Display message if spaces are available if spaces>0: print("Available spaces") # Display a different message if spaces are not available print("Sorry, the parking lot is full")
10 Answers
+ 8
What is your output? Did you compare your with expected output?
What is the task actually? Add full description also and share code link by saving it. That's helps to find what is your problems with code.
+ 3
'if spaces are not available.. ' where is this conditional check?
Save code and share link..
indentation is important in python.
+ 2
Add your task description...
+ 1
"""The first line is a comment, not instruction so you should comment it..
last output statement only displayed when if condition fails so add it into else block.
here is full corrected working code """
#Take the number of available spaces as an input
spaces=int(input())
# Display message if spaces are available
if spaces>0:
print("Available spaces")
# Display a different message if spaces are not available
else :
print("Sorry, the parking lot is full")
+ 1
# Tomar el número de espacios disponibles como entrada
spaces = int(input())
# Mostrar mensaje si hay espacios disponibles
if spaces>0:
print("Available spaces")
# Mostrar un mensaje diferente si no hay espacios disponibles
else:
print("Sorry, the parking lot is full")
0
Ok
0
The space available is 20
0
#Take the number of available spaces as an input
spaces=int(input())
# Display message if spaces are available
if (spaces>0):
print("Available spaces")
# Display a different message if spaces are not available
else :
print("Sorry, the parking lot is full")
0
# Take the number of available spaces as an input
spaces = int(input())
# Display message if spaces are available
if spaces <=20 and spaces > 0:
print("Available spaces")
elif spaces == 0:
print("Sorry, the parking lot is full")