Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Working on a python project and there are syntax errors never faced before

    def main_menu():
        print("WELCOME TO LIBRARY")
        print("What would you like to do?")
        option=print(input("1. New user \n 2. Existing user ")

        if option == 1:
            new_user()
        elif option == 2:
            old_user()
        else:
            print("please choose a correct value")
            main_menu()

    def new_user():
        print("new user")

    def old_user():
        print("Old user")
    main_menu()

Here is a picture of the error, it says syntax error missing ")" for function call and missing "else" for the first one at "if":

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

the line

option=print(input("1. New user \n 2. Existing user ")

is missing a closing )
it should be

option=print(input("1. New user \n 2. Existing user "))
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading