+ 1

I am using Microsoft visual studio. I type the code as instructed but I am having errors. I'm learning cpython. I need answers

systaxError: invalid syntax

28th Dec 2017, 2:28 AM
IamZues
IamZues - avatar
6 Answers
+ 5
Yes. Indentations are part of the syntax which Python enforces.
28th Dec 2017, 2:55 AM
Hatsy Rei
Hatsy Rei - avatar
+ 4
Post your code, perhaps?
28th Dec 2017, 2:38 AM
Hatsy Rei
Hatsy Rei - avatar
+ 4
Indentations are whitespaces placed on the same line prior to your code. E.g. #indented #not indented #indented similarly to line 1 #further indented This means that Python groups codes with similar levels of indentations into a single block (instead of other languages which commonly utilises brackets. {} )
28th Dec 2017, 4:28 AM
Hatsy Rei
Hatsy Rei - avatar
+ 1
I just got it right now. At first, when I type in the code. it was like this.. x = 4 if x == 5: print("false") else: print("true") but when I arrange it properly, it worked. x = 4 If x == 5: print("false") else: print("true")
28th Dec 2017, 2:49 AM
IamZues
IamZues - avatar
0
That's alot I really didn't understand it clearly but I get it now... thanks for the support..
28th Dec 2017, 2:56 AM
IamZues
IamZues - avatar
0
I am a bit confused.. Please can you explain it properly to me what does it really mean by the indentations?
28th Dec 2017, 3:13 AM
IamZues
IamZues - avatar