while True: try: password = input() list1 = ['abc', 'def', 'ghi', 'jkl', 'mno', 'pqrs', 'tuv', 'wxyz'] result = '' for i in password: ...