4 ms·
I still can't get why they replaced: `print "abc"` with `print("abc")`. Python REPL was my go to shell calculator and it is quite elaborate to put the parenthe
by krzyk 6y ago
I still can't get why they replaced: `print "abc"` with `print("abc")`.
Python REPL was my go to shell calculator and it is quite elaborate to put the parentheses around what I would like to print, for me that was the main drawback of python3.
But I don't write production code in python, it is used only for small shell scripts, or like calculator.
- HDevo 6y agoFor basic calculations, let me recommend bc to you: https://en.wikipedia.org/wiki/Bc_(programming_language) https://en.wikipedia.org/wiki/Bc_(programming_language) This way you don't even have to type "print" ;)
- krzyk 6y agoI don't need to type it in python also, unless I do some loops or functions. I tried bc once and it was too big learning curve for just simple calc that indo in python.
- tephra 6y agoHaving print as a function instead as a statement provides flexibility and ease of customizing. Printing to anything but stdout, printing with a separator, using the end keyword, etc, all became easier.
- Too 6y agoIf you use the REPL as a calculator you don't even need print at all! The terminal will automatically print the result of your last statement! >>> 5+5 10
- krzyk 6y agoYes I know that. But look at my comment above, I use also for loops and functions.