'TypeError Not all Arguments Converted During String Formatting
I'm trying to loop through the Numbers List and on each iteration I want to check if the added Number were even or single but Unfortunately I've got this error.
#!/usr/bin/env python
import time
ask = int(input("How Many Numbers You Want to Print ? : "))
numbers = []
for i in range(0, ask):
x = input("What's Number " + str(i+1) + " : ")
numbers.append(x)
for y in numbers:
if (y % 2) == 0:
print("Even Numbers : " + y)
But When I run my code its Giving me :
_Projects/network_scanner/test.py
How Many Numbers You Want to Print ? : 3
What's Number 1 : 15
What's Number 2 : 16
What's Number 3 : 13
Traceback (most recent call last):
File "/home/user/Desktop/Python_Projects/network_scanner/test.py", line 11, in <module>
if y % 2 == 0:
TypeError: not all arguments converted during string formatting
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
