Python qwerty keyboard checker I am creating a code which checks a user inputted password and gives points based on it. One of the points is: If it has 3 letters adjacent/consecutive on the QWERTY UK keyboard then it will be -5 points. e.g "qwerty" will be -20 points for "qwe" "wer "ert" "rty". I have got a solution to this but I was wondering if there is any way of improving it.

input = input("What is your password?")
qwerty = 'qwertyuiopasdfghjklzxcvbnm'
lower = input.lower()
for idx in range(0, len(lower) - 2):
    test_seq = lower[idx:idx + 3]
    if test_seq in qwerty:
        points -= 5
print(points)
According to my interpretation, your solution does not actually meet the specification:


  If it has 3 letters adjacent/consecutive on the QWERTY UK keyboard then it will be -5 points


For example, pas does not have three adjacent keys on a QWERTY keyboard, yet it gets penalized by your code.  On the other hand, your code fails to detect backwards adjacent sequences such as ewq.