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.

14th Jan 2019, 2:44 PM
Lorenzo
Lorenzo - avatar
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)
14th Jan 2019, 2:48 PM
Anna
Anna - avatar