0
myvar = "How are you ?"    
print("%s %s") % (hello, myvar)    

Its one of my python Task for University but it doesnt work ?? I use Python 3 could it be for 2 ?? And how would it look like for 3 then ?

Opaldes
  • 183
  • 1
  • 10

2 Answers2

2

You should move it inside brackets

print("%s %s" % (hello, myvar))

as in your case "%" is used in the context "NoneType tuple", while it should be used in a context "str tuple"

lejlot
  • 61,451
  • 8
  • 126
  • 152
-1

In python3, the print is a function unlike in python 2 where it is actually a statement.

so, as it is told, in python3 give the argument inside () ie

print(hello, myvar)
nishparadox
  • 700
  • 5
  • 13