I am stucking on Smart Parking Lot Practice on Introduction to Python lesson, could you help me? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I am stucking on Smart Parking Lot Practice on Introduction to Python lesson, could you help me?

Practice on Introduction to Python lesson

19th Jun 2023, 12:40 PM
Andriamavo Tianarivo Rabenjamina
Andriamavo Tianarivo Rabenjamina - avatar
12 Answers
+ 3
# Take the number of available spaces as an input input = 20 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")
20th Jun 2023, 5:11 AM
Andriamavo Tianarivo Rabenjamina
Andriamavo Tianarivo Rabenjamina - avatar
+ 2
Could you show your attempt 🤔
19th Jun 2023, 3:29 PM
Hasnain [ACTIVE CHALLENGER]
Hasnain [ACTIVE CHALLENGER] - avatar
+ 2
Andriamavo Tianarivo Rabenjamina Can you also provide a description of the task please. Meantime 1. int(input()) # integer input syntax 2. Don't use input as a variable 3. I think you need to review your comparison section against the task description
20th Jun 2023, 11:32 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 2
Problem solved, thank you for your help.
20th Jun 2023, 11:48 AM
Andriamavo Tianarivo Rabenjamina
Andriamavo Tianarivo Rabenjamina - avatar
+ 2
# Take the number of available spaces as an input spaces = 20 spaces = int(input()) # Display message if spaces are available if spaces > 0 and spaces <= 20: print("Available spaces") # Display a different message if spaces are not available else: print("Sorry, the parking lot is full")
25th Nov 2023, 11:06 AM
Stas Derdziak
Stas Derdziak - avatar
+ 1
The description of problem an task are: A smart parking lot displays different messages to the visitor based on the number of available spaces. Task Complete the program to inform the user about available spaces in the parking lot Thank you fo your help.
20th Jun 2023, 11:41 AM
Andriamavo Tianarivo Rabenjamina
Andriamavo Tianarivo Rabenjamina - avatar
+ 1
Try to understand the code first, then try doing it yourself, if you are still stuck, provide the link to your code and provide an explanation of what you want to do and what have you done.
21st Jun 2023, 9:34 AM
Danish Zubair
Danish Zubair - avatar
20th Jun 2023, 8:43 PM
Rik Wittkopp
Rik Wittkopp - avatar
0
A smart parking lot displays different messages to the visitor based on the number of available spaces. Task Complete the program to inform the user about available spaces in the parking lot
25th Aug 2023, 1:04 PM
Hariprasath
Hariprasath - avatar
0
The correct Code to this is: # Take the number of available spaces as an input spaces = int(input()) # Display message if spaces are available if spaces > 0 and spaces <= 20: print("Available spaces") else: print("Sorry, the parking lot is full")
28th Nov 2023, 8:54 AM
SGerhard
SGerhard - avatar
0
This is the right code # Take the number of available spaces as an input spaces = 20 spaces = int(input()) # Display message if spaces are available if spaces > 0 and spaces <= 20: print("Available spaces") # Display a different message if spaces are not available else: print("Sorry, the parking lot is full")
8th Jan 2024, 5:36 PM
Sizwe
0
# Take the number of available spaces as an input spaces = 20 spaces = int(input()) # Display message if spaces are available if spaces > 0 and spaces <= 20: print("Available spaces") # Display a different message if spaces are not available else: print("Sorry, the parking lot is full")
28th Feb 2024, 1:26 PM
S.H.G.S.Gunarathna