well what im trying to do its when you input a "-Number"
it will print something
and this the error im getting:
Traceback (most recent call last): File "main.py", line 10, in
if "-" in use: TypeError: argument of type ‘int’ is not iterable
this is my code
n1 = 800
use = []
use2 = []
while use != n1:
use = int(input("Money: "))
use2.append(use)
print("The money that left:",800 - sum(use2))
if "-" in use:
print('ok')
>Solution :
n1 = 800
use = []
use2 = []
while use != n1:
use = input("Money: ")
use2.append(int(use))
print("The money that left:",800 - sum(use2))
if "-" in use:
print('ok')
Worked for me!