+ 1

Whats an "Intendation Error"

This Error wrecks all my codes and I dont know what it is, pls help me.

2nd Dec 2016, 7:52 PM
ASTROfocs
ASTROfocs - avatar
5 Réponses
+ 3
It means you have wrong formatting for your code. Please post your code so we can help!
2nd Dec 2016, 8:07 PM
James Flanders
+ 2
EXAMPLES: ## WRONG! if(5 > 4): print("Yes") ## CORRECT if(5 > 4): print("Yes") When you indent your python code make sure that there's atleast 4 spaces, if not change your TAB settings (depends on your editor.)
2nd Dec 2016, 8:40 PM
Nedim Kanat
Nedim Kanat - avatar
0
in Python indentation is used to create a block of code. example in C++ you would do this to create a block of code with "if" : if (x== 10) { cout << " x is greater than 5"; } you use { } to create a block of code in Python it would be something like this : if x == 10: print("x is greater than 5") the second line is indented to be in the "if" block
2nd Dec 2016, 8:37 PM
Bahhaⵣ
Bahhaⵣ - avatar
0
THX guys
2nd Dec 2016, 9:07 PM
ASTROfocs
ASTROfocs - avatar
- 1
Try: Num = 6 print (Num/0) except IntendationError : print ("crap") finally : print ("Dont know if it works")
2nd Dec 2016, 9:02 PM
ASTROfocs
ASTROfocs - avatar