Answer the question
In order to leave comments, you need to log in
How to display many variables correctly in print in python?
Hello.
Python 3.9.1
How to output properly?
a = 1
b = 2
c = 3
d = 'sss'
print('D = %s, C = %d, B = %d, A = %d' % d % c % b % a)
Traceback (most recent call last):
File "<string>", line 6, in <module>
TypeError: not enough arguments for format string
>
Answer the question
In order to leave comments, you need to log in
import time
def main() -> None:
a = 1
b = 2
c = 3
d = 4
e = 5
some_string = f'{a} {b} {c} {d} {e}'
print(some_string)
if __name__ == '__main__':
main()
time.sleep(10)
def main_2() -> None:
a = 1
b = 2
c = 3
d = 4
e = 5
some_string = f'{a} {b} {c} {d} {e}'
print(a, b, c, d, e)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question