+ 1
I am trying to run the code below in Ubuntu but I am getting it wrong.
if 10 > 5: print("10 greater than 5") print("Program ended")
9 odpowiedzi
0
but Python 2 supports both with parentheses and with out parentheses.
+ 4
Hmm... working fine even in Sololearn.
Maybe you are using Python 2.7 on your Ubuntu installation?
+ 3
In Python 2.7 print is a statement, not a method.
Its syntax is indeed with no parentheses, like @shaldem suggested.
+ 3
if 10 > 5:
print "10 greater than 5"
print "Program ended"
# so to say it simply - write the same without the brackets
0
Yes please I am using python 2.7. but what can I do to make it work please?
0
Hmm, I think you need to right print in anather wey, like this:
print "Program ended"
0
please what can I do to solve this Kuba?
0
please what can I do to solve this Kuba?
0
thank you all, it works now.