I've been learning python in a couple weeks and doing some challenges. My question is: I'm gonna ask for 2 ints inputs from user and put on a list ''list = []'' if the user write the same value(int) I have to print a message like ''Denied, already on list'' that's my code so far:
list = []
yourn = ' ' #yesorno
while yorn != 'n': #condition to break the loop
list.append(int(input('Insert a number: ')))
*** #thats where I'm stucked
***for rep in list
if rep not in lista:
continue
else:
print('duplicate')****
** (I know that's no the right way, thats just me trying it out)
yorn = str(input('Continue? [Y/N]: ')).strip().lower()[0]
print('END!')
print(f'The numbers are: {sorted(list)} ', end=' → ')
trying my best here! thanks!!
I tried 'for' loop to identify a repeat number and if to get the condition