Skip to content

Instantly share code, notes, and snippets.

@Wemmy0
Last active June 15, 2023 11:03
Show Gist options
  • Save Wemmy0/977b5021fb4a6ecd907570981378fd3c to your computer and use it in GitHub Desktop.
Save Wemmy0/977b5021fb4a6ecd907570981378fd3c to your computer and use it in GitHub Desktop.
One line version of the AQA A-Level Computer Science algorithm question on section B
while True: eval(["exit()" if all(i in "QWERTYUIOPASDFGHJKLZXCVBNM" for i in user) and user.upper() == user and len(set(user)) == len(user) and sum([ord(i) for i in user]) >= 420 and sum([ord(i) for i in user]) <= 600 and len(user) >= 5 and len(user) <= 7 else "print ('Not Valid!')" for user in [input("> ")]][0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment