I need help with conditionals. Trouble with Indentation. /u/Due-Homework-6905 Python Education

Hello, I need some help with conditionals. I’m new in python, learning by myself. I written this code on VScode, however I’m having some trouble with it.

if age >= 18: print('I can drink alcohol') print('Ill grab a beer') else: print('I cannot') 

I get this error in the terminal: I know the error is somewhere in the indentation, but I do not understand how it happened. I’ve used the 4 spaces instead of tab and the code is particularly simple.

>>> if age >= 18: ... print('I can drink alcohol') ... print('Ill grab a beer') ... else: ... print('I cannot') ... File "<python-input-0>", line 3 print('Ill grab a beer') IndentationError: unexpected indent >>> 

submitted by /u/Due-Homework-6905
[link] [comments]

​r/learnpython Hello, I need some help with conditionals. I’m new in python, learning by myself. I written this code on VScode, however I’m having some trouble with it. if age >= 18: print(‘I can drink alcohol’) print(‘Ill grab a beer’) else: print(‘I cannot’) I get this error in the terminal: I know the error is somewhere in the indentation, but I do not understand how it happened. I’ve used the 4 spaces instead of tab and the code is particularly simple. >>> if age >= 18: … print(‘I can drink alcohol’) … print(‘Ill grab a beer’) … else: … print(‘I cannot’) … File “<python-input-0>”, line 3 print(‘Ill grab a beer’) IndentationError: unexpected indent >>> submitted by /u/Due-Homework-6905 [link] [comments] 

Hello, I need some help with conditionals. I’m new in python, learning by myself. I written this code on VScode, however I’m having some trouble with it.

if age >= 18: print('I can drink alcohol') print('Ill grab a beer') else: print('I cannot') 

I get this error in the terminal: I know the error is somewhere in the indentation, but I do not understand how it happened. I’ve used the 4 spaces instead of tab and the code is particularly simple.

>>> if age >= 18: ... print('I can drink alcohol') ... print('Ill grab a beer') ... else: ... print('I cannot') ... File "<python-input-0>", line 3 print('Ill grab a beer') IndentationError: unexpected indent >>> 

submitted by /u/Due-Homework-6905
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *