So I wanna try to separate some lines of user input using space, that input can only handle int, I created a variable that removed the same number from the splitted user input
for item in separated:
print(item)
loopCount = noOccur.count(item)
if loopCount == 0:
noOccur += item
Some weird thing happened if I inputted a number that's more than 10 for example
userIn = input('Numbers: ') # 0 8 89
but that function separated the last number into ['0', '8', '8', '9']
that function worked in single digits but it doesn't work in double digits
userIn = input('Please enter your numbers: ') # 689 688 3405
separated = userIn.split()
noOccur = []
for item in separated:
print(item)
loopCount = noOccur.count(item)
if loopCount == 0:
noOccur += item
length = len(noOccur)
i = 0
print(noOccur) # ["6", "8", "9", "6", "8", "8", "3", "4", "0", "5"]
print(separated)
while i < length:
tempVar = noOccur[i]
print(str(tempVar) + ": " + str(separated.count(tempVar)))
i += 1
I think my for loop is a little bit broken, because I tried split(" ") as mentioned in the answer but it still added it individually