+ 7

When does a new block begin in python?

Please tell me as soon as possible

18th Jul 2019, 12:44 PM
Ashish Yadav
Ashish Yadav - avatar
5 Respostas
+ 2
Ashish Yadav You can create a new block using indentation
18th Jul 2019, 2:05 PM
deeyae
deeyae - avatar
+ 2
Ashish Yadav A block begins also with one or more spaces which is called as an indentation It's not by 4 spaces only If you can't believe it just see the code below https://code.sololearn.com/cFjZ5x2CeGhj/?ref=app
19th Jul 2019, 9:52 AM
deeyae
deeyae - avatar
+ 1
Unlike other languages python uses identation operator rather than curly brackets. Example : if(x<9) if(x>3) This is a nested if statement. You can notice a space before the second if right that's identation.
19th Jul 2019, 1:26 PM
Manoj
Manoj - avatar
+ 1
A block is indented code that starts right after a colon and ends when the indentation ends.
20th Jul 2019, 6:00 AM
David Ashton
David Ashton - avatar