I'm a beginner in python and I'm facing an error :IndentationError: expected an indented block"
for the following simple code
num = 3
if num >= 0:
print("positive number")
else:
print("Negtive number")
I need to fix this in python 3.7
I'm a beginner in python and I'm facing an error :IndentationError: expected an indented block"
for the following simple code
num = 3
if num >= 0:
print("positive number")
else:
print("Negtive number")
I need to fix this in python 3.7
Another approach can be:
1) Select the entire content of the file "(Ctrl + A)".
2) Then find an option like "Converting Indentation to Spaces" in your Text Editor.
Python doesn't use braces. It uses indentation to determine which block of code comes under which.
I'd recommend using tabs over spaces. Just backspace all the spaces behind the print statement and then use tab to indent it.