Pārlūkot izejas kodu
Adding mention of `end` parameter for `print`
Based on:
From: sourin.sutradhar@gmail.com
Hi Swaroop,
I am a C/C++ programmer. Recently I have started learning python from
your book. Your way of writing is really awesome and clean. As for
suggestion, I think it would be nice if you add a small section on
formatted output.
For example:
In your PDF version of Byte of python, at the end of page 44 in
section8.3, you have described a program to print numbers using for
loop. But as per the output all the numbers are getting printed in new
lines. This is confusing , especially for C/C++/Java programmers. As for
such situations you can add a note describing that to avoid the newline,
one can also write is as follows (though there are many other methods):
for i in range(1,5):
print(i, end=' ')
#to avoid newline
Or you can add a whole section in the book to descrive formatted output
in python. That will be helpful for beginners.
Thank you Swaroop. Really enjoying your book on Python.
Best of luck.