![]() |
Why does function print require bracket for text? - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Why does function print require bracket for text? (/thread-10512.html) |
Why does function print require bracket for text? - richardm55 - May-23-2018 Hello, I've just started to learn Python from the book "Python from beginning" Peter Norton. In chapter 1 I learnt about using function print and it uses quatation marks for text but I try to do it practically I get an error that function print require brackets. I use Python IDE editor version 3.6 RE: Why does function print require bracket for text? - nilamo - May-23-2018 (May-23-2018, 05:34 PM)richardm55 Wrote: I get an error that function print require brackets. What version of python is the book written for? In python 2.x, print "some words" was valid, but in python 3.x that is now a syntax error, and should be written as print("some words")
RE: Why does function print require bracket for text? - buran - May-23-2018 just to add that you should stick to python 3.6 and [maybe] find a book that is not targeted at python2 |