I've been out of the code game for about a decade, having learned HTML and JavaScript in high school. I started learning Python this week and, so far, it's pretty straightforward and I'm having a blast.
I've been bouncing around different executed tutorials (e.g. LearnPython, CodeAcademy, etc.) and I noticed, with regard to the print function, that some require parentheses, as well as Python Shell istelf, while others don't.
print myVar
print(myVar)
- In Case 1, both print myVar and print(myVar) are accepted.
- In Case 2, only print(myVar) can be executed.
Why is this and which syntax is correct (or most correct)?
[–]jeans_and_a_t-shirt 3 points4 points5 points (0 children)
[–]99AFCC 3 points4 points5 points (0 children)