Skip to content

Instantly share code, notes, and snippets.

@scandiumby
Created May 12, 2022 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scandiumby/b6439180a4a31678fb52b2ef999f4ebb to your computer and use it in GitHub Desktop.
Save scandiumby/b6439180a4a31678fb52b2ef999f4ebb to your computer and use it in GitHub Desktop.
Python example for IT English course
import random
english_goals = {
"a": "Free communication with colleagues and customers",
"b": "I want to become an IT specialist",
"c": "Easy to read documentation in English",
"d": "I don't need to learn English",
"e": "Make a choice instead of me",
}
def process_choice(user_goal_key: str) -> None:
match user_goal_key:
case "a"|"b"|"c":
print("Welcome to IT English. It's easy for you!")
case "d":
print("Really? Think one more time :)")
case "e":
random_goal_key = random.choice(list(english_goals.keys()))
print(f"Random choice: {english_goals[random_goal_key]}")
process_choice(random_goal_key)
case _:
print("Unknown choice!")
if __name__ == '__main__':
user_goal = input(f"What is the goal of learning English?\n{english_goals}:")
process_choice(user_goal)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment