'TypeError: not all arguments converted during string formatting-what does bracket do in this case?
The first code runs correctly but the second one does not. What is the problem here?
first code
print("%d" %100,100)
100 100
second code
print("%d" %(100,100))
- The error message from the console
Traceback (most recent call last): File "<pyshell#96>", line 1, in print("%d" %(100,100)) TypeError: not all arguments converted during string formatting
Solution 1:[1]
Change this line
print("%d" %(100,100))
To
print("%d" %100,100)
It will solve your problem. Thank You.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | CodeWithYash |
