Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. def main():
  2.     used_words = []
  3.     while True:
  4.         word = input("Type 4 letter word: ")
  5.         if len(word) == 4 and word not in used_words:
  6.             used_words.append(word)
  7.             print("good job, try another word")
  8.         elif word in used_words:
  9.             print("word already exists")
  10.         elif len(word) != 4:
  11.             print("word is not 4 letters long")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement