Contact: aviboots(AT)netvision.net.il
39,970 questions
51,912 answers
573 users
a = 4 b = 7 c = 9 # TypeError: not enough arguments for format string # s = "a = %s b = %s c = %s" % a, b ,c s = "a = %s b = %s c = %s" % (a, b ,c) print(s) ''' run: a = 4 b = 7 c = 9 '''
a = 4 b = 7 c = 9 # TypeError: not enough arguments for format string # s = "a = %s b = %s c = %s" % a, b ,c s = "a = {0} b = {1} c = {2}".format(a, b, c) print(s) ''' run: a = 4 b = 7 c = 9 '''
a = 4 b = 7 c = 9 # TypeError: not enough arguments for format string # s = "a = %s b = %s c = %s" % a, b ,c s = f"a = {a} b = {b} c = {c}" print(s) ''' run: a = 4 b = 7 c = 9 '''