0
How do I make a list and stop it with "=" sign, because I stop when number is negative, but I want to enter all numbers, positiv
8 Answers
+ 3
yes, because = is not an integer. in this situation you need to:
take strings
check if that string is a =
if not, change to integer and add to list
+ 2
lista = []
while True:
nĂșmero = input("Give me another number: ")
if nĂșmero == '=':
break
lista.append(int(nĂșmero))
+ 1
Take a look
https://code.sololearn.com/cvu3OnC7TF2o/?ref=app
+ 1
Try this one
https://code.sololearn.com/cOULiL6UqPWR/?ref=app
+ 1
Yeeeaahhh đđđ đȘđđ thanks
+ 1
Hii
0
Return error đđđ
0
Uff, error again, it says:
Traceback (most recent call last):
(Adress in pc), line9, in <module>
nĂșmero = int(input("Give me another number: "))
ValueError: invalid literal for int() with base 10: "="