Skip to content

Instantly share code, notes, and snippets.

@MaodeColombia
Last active November 23, 2021 02:18
Show Gist options
  • Save MaodeColombia/3ef1151ee59bb3deaf219482b7b09c37 to your computer and use it in GitHub Desktop.
Save MaodeColombia/3ef1151ee59bb3deaf219482b7b09c37 to your computer and use it in GitHub Desktop.
Combination from lowercase and digits
lowercase = 'abcdefghijklmnopqrstuvwxyz'
digits = '0123456789'
#List Comprehensions form
answer = [i+j+k+l for i in lowercase for j in lowercase for k in digits for l in digits]
#traditional form
answer2=[]
for a in lowercase:
for b in lowercase:
for c in digits:
for e in digits:
answer2.append(a+b+c+e)
print(correct_answer == answer)
print(correct_answer == answer2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment