I ask the user to enter a list of 4 numbers and I have to verify that they are all different (if not he has to do it again), however it is a piece of a bigger homework and I can only use simple/basic code, meaning I can't use sets or any function, only lists, loops ...
So I asked the user to enter 1 element at a time to compare them everytime with the ones already entered but I guess there is a much easier way to do so. My program looks like :
code= input ("enter a list of four distinct numbers between 1 and 8:")
for c in code:
while type (code)!=list or len(code)!=4 or type(c)!=int or code[c]<1 or code[c]>8 or ????????? :
print "try again ! this is not correct"
code=input("enter a list:")
How can I do that ? Thank you