Click here to Skip to main content
15,905,325 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
separator = input()
y = []
z = []
for i in separator:
if i // 2 == 0:
y.append()
else:
z.append()


every time I want to run this code I see this problem:

TypeError: unsupported operand type(s) for //: 'str' and 'int'

What I have tried:

I'm getting everything I can think of
Posted
Updated 2-Jun-22 1:45am
v2

You need to convert the input text to an integer:
Python
separator = int(input())

You also need to tell the lists what you want to append to them.

See The Python Tutorial — Python 3.10.4 documentation[^] For the definitive guide.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900