0
Can we use curly braces in loop
3 odpowiedzi
+ 5
You need to get used to Python way even though it might be ugly to people with C++, C#, PHP, Java and Javascript background.
+ 1
you don't need curly braces, it's python, therefore you should embrace the python way of doing things
0
No. In Python, the same purpose (delimiting blocks of code) is performed by indentation - all indented lines below the loop start are part of the loop code.
While the use of indentation for this purpose is debatable, it does have one advantage - it forces you to keep your code clean and readable :)