how do you use multiple %s in a python output?
TEXT = 'Hi, your first name is %s' %Fname
This works fine but...
TEXT = 'Hi, your first name is %s and your last name is %s' %Fname %Lname
I get the error
TypeError: not enough arguments for format string
You need to use tuples:
Also, consider using
format()
.or
I like using string format instead.
So
Give all the variables in a tuple, like this:
Use a tuple:
Better: use
str.format(*args, **kwargs)
.