def ask(question):
    while True:
        print(f"\n{question}")
        print("1 = Yes")
        print("2 = No")
        answer = input("> ")
        if answer in ["1", "2"]:
            return answer
        print("❗ Please enter 1 for Yes or 2 for No.")

def restart():
    if ask("🔁 Would you like to start over?") == "1":
        print("\n--- Restarting ---")
        start()
    else:
        print("👋 Thanks for participating. Exiting the program.")

def start():
    if ask("🤔 Are you generally interested in how valuable information can be obtained from data - in other words, in data science?") == "1":
        if ask("📊 When dealing with data, do you want to understand how companies use it to better understand customers, optimise processes or develop digital business models?") == "1":
            if ask("🎯 DIGITAL BUSINESS & Data Science might be the best fit for you. Would you like to learn more?") == "1":
                print("ℹ️ Learn more here: https://www.wiwi.uni-wuerzburg.de/studium/bachelor/dbds/")
            else:
                print("👍 Thanks for participating. Exiting the program.")
            restart()
        else:
            if ask("💻 Do you enjoy programming and would you like to learn how to develop intelligent systems such as voice assistants or image analyses?") == "1":
                if ask("🧠 Are you interested in the technological core of AI - e.g. neural networks, algorithms and machine learning - and would you like to work on practical AI projects?") == "1":
                    if ask("🚀 KI & DATA SCIENCE might be the best fit for you. Would you like to learn more?") == "1":
                        print("ℹ️ Learn more here: https://www.informatik.uni-wuerzburg.de/studium/studiengaenge/bachelor-kuenstliche-intelligenz-und-data-science/")
                    else:
                        print("👍 Thanks for participating. Exiting the program.")
                    restart()
                else:
                    if ask("📘 Would you like to understand and develop the mathematical foundations of data science and machine learning, and do you enjoy working analytically on complex problems?") == "1":
                        if ask("📚 MATHEMATICAL DATA SCIENCE might be the best fit for you. Would you like to learn more?") == "1":
                            print("ℹ️ Learn more here: https://www.uni-wuerzburg.de/studium/angebot/faecher/mathematical-data-science/")
                        else:
                            print("👍 Thanks for participating. Exiting the program.")
                        restart()
                    else:
                        print("🤷‍♂️ It looks like you're not 100% sure which Data Science degree programme suits you best. Feel free to contact us to clarify this again.")
                        if ask("📩 Would you like to write to us?") == "1":
                            print("📧 Feel free to email us at bachelor@wiwi.uni-wuerzburg.de")
                        else:
                            print("👍 Thanks for participating. Exiting the program.")
                        restart()
            else:
                print("😕 It looks like your interests don't (yet) fit 100% with our Data Science degree programmes. Please contact us to clarify this again.")
                if ask("📩 Would you like to write to us?") == "1":
                    print("📧 Feel free to email us at bachelor@wiwi.uni-wuerzburg.de")
                else:
                    print("👍 Thanks for participating. Exiting the program.")
                restart()
    else:
        print("😕 It looks like your interests don't (yet) fit 100% with our Data Science degree programmes. Please contact us to clarify this again.")
        if ask("📩 Would you like to write to us?") == "1":
            print("📧 Feel free to email us at bachelor@wiwi.uni-wuerzburg.de")
        else:
            print("👍 Thanks for participating. Exiting the program.")
        restart()

if __name__ == "__main__":
    start()
