who can figure out this
Using a “while loop” ask the user for a number and add it to a list if number is even and to a different list if number is odd. Keep asking the user for a number until he says “I’m bored” and doesn’t want to give you any more numbers.
L=["1","2","3","5" ]
Odd= ["1"]
while True:
print("hello")
number = int(input("give me a number? ")
if number == L % 2:
print(L)
elif number in L % 1 == 0:
print(Odd)
elif "im bored":
print("ok thanks for your help!")
output when ran is:
L=["1","2","3","5" ]
Odd= ["1"]
while True:
print("hello")
number = int(input("give me a number? ")
if number == L % 2:
print(L)
elif number in L % 1 == 0:
print(Odd)
elif "im bored":
print("ok thanks for your help!")
File "<ipython-input-7-c06cac4d7836>", line 6
if number == L % 2:
^
SyntaxError: invalid syntax
Using a “while loop” ask the user for a number and add it to a list if number is even and to a different list if number is odd. Keep asking the user for a number until he says “I’m bored” and doesn’t want to give you any more numbers.
L=["1","2","3","5" ]
Odd= ["1"]
while True:
print("hello")
number = int(input("give me a number? ")
if number == L % 2:
print(L)
elif number in L % 1 == 0:
print(Odd)
elif "im bored":
print("ok thanks for your help!")
output when ran is:
L=["1","2","3","5" ]
Odd= ["1"]
while True:
print("hello")
number = int(input("give me a number? ")
if number == L % 2:
print(L)
elif number in L % 1 == 0:
print(Odd)
elif "im bored":
print("ok thanks for your help!")
File "<ipython-input-7-c06cac4d7836>", line 6
if number == L % 2:
^
SyntaxError: invalid syntax