Created
May 12, 2022 13:40
-
-
Save scandiumby/b6439180a4a31678fb52b2ef999f4ebb to your computer and use it in GitHub Desktop.
Python example for IT English course
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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