0

Why do we ommit lines when writing codes in python? Thanks.

8th Jan 2019, 6:33 AM
Adesiyan Joseph
4 ответов
+ 4
You don't have to omit lines in Python, but you can, in order to make your code more readable.
8th Jan 2019, 7:14 AM
HonFu
HonFu - avatar
+ 2
What do you mean by "omitting lines"? Can you give an example of that?
8th Jan 2019, 6:44 AM
Diego
Diego - avatar
+ 1
For instance: 1. # Program to add two numbers 2. 3. num1 = 6 4. num2 = 5 5. print(num1 + num2) 6. 7. # output is 11. Why do we ommit line 2 and line 6?
8th Jan 2019, 7:14 AM
Adesiyan Joseph
+ 1
Read also what PEP8 (python code styling guidelines) has to say about blank lines https://www.python.org/dev/peps/pep-0008/#blank-lines
8th Jan 2019, 10:39 AM
Tibor Santa
Tibor Santa - avatar