Imagine that I have this list:
a=[ {'name':'John','number':'123'} , {'name':'Mike','number':'12345'} ,{'name':'Peter','number':'12'}]
name=input('insert your name')
number=input('insert your number')
If I want to have 3 scenarios: one where the name and number matches, the second where the name is correct but the number is incorrect and the last one where the name does not exist.
if {'name':name,'number':number} in a:
print('okay')
else:
if {'name':name} in a and {'number':number} not in a:
print('user okay, but incorrect pass')
else:
print('No username')
This type of code will not work, right? So how can I solve the second step (after the first else)?