Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function validateAnswer(answer, randomLetters[])
- if answer.length > 10:
- print("0") ### Checks to see if the answer is within the valid size (10)
- else:
- for i in range(answer.length()):
- if randomLetters[0] is in answer:
- randomLetters.remove[0] ### Checks if the letters in the answer are in the given 10 letters
- else: ### Also returns "0" if there are repeated letters as the originals are removed if used
- print("0")
- if randomLetters.length() == 0:
- print(answer.length())
- endFunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement