0
Why doesn't this work?
data = ["John", "Doe", 53.44] message = "Hello, %s %s. Your balance is $%s." print(message % data) It tells me there are not enough arguments for format string to work.
1 Answer
+ 3
data = ("John", "Doe", 53.44) # tuple
message = "Hello, %s %s. Your balance is $%.2f." # last one is float instead of string
print(message % data)