0

Why does this code have a syntax error?

In SoloLearn lessons when writing a little code it starts with >>>, nevertheless when I write something, e.g. this: >>> "Hello world" ----- It appears me a syntaxerror. What could it be? Thanks!

3rd Jul 2016, 9:42 PM
Marco Antonio González
Marco Antonio González - avatar
3 Antworten
+ 3
You don't need to write >>>. That is something the shell puts there to indicate a new statement. To display text in console, use print () E.g print ("Hello World")
3rd Jul 2016, 10:40 PM
Gershon Fosu
Gershon Fosu - avatar
0
yup in python3 close it with () in python 2 just use " or '
4th Jul 2016, 1:25 AM
Talha Khan
Talha Khan - avatar
- 1
needs print and enclosed with ()
3rd Jul 2016, 9:53 PM
alan