How to find the repeated items of a tuple in Python

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

loop = 1
while loop == 1:
print("options are:")
print("1.repeated tuple")
print("2.exit")
choice = int(input("enter choice:"))
if choice == 1:
values = input("Input some comma separated numbers : ")
list = values.split(", ")
tuple = tuple(list)
print('Tuple : ', tuple)
for i in tuple:
if tuple.count(i) > 1:
print(i)


For this i want to print only the repeated item once, but idk how..
Hope you will see this..

anjanakrishnaDraco
Автор

Hey! The question was to find the repeated item tho y did you use count? And how to do if its user input

anjanakrishnaDraco
welcome to shbcf.ru