Nothing happens when I run my code

I’m writing a piece of code for a scoring system, however, every time I try to run it nothing happens, can anyone help?

My code:

def scoringsystem():
    print("Welcome to the menu")
    print()
    a=True
    while a==True:
        print("Would you like to input for Individuals i or a Team t")
        answer = input("Enter here : ")
        if answer == "t":
                event = input("What event did they do?")
                placement = str(input("What position did they come? "))
                if placement == "1st":
                    print ("They got 3 points!")
                if placement == "2nd":
                    print ("They got 2 points!")
                if placement == "3rd":
                    print ("They got 1 point!")
                else:
                    print("They got zero points, sorry.")
                if answer == "i":
                    event = input("What event did you do?")
                placement = input("What position did you come?")
                if placement == "1st":
                    print ("You got 3 points!")
                if placement == "2nd":
                    print ("You got 2 points!")
                if placement == "3rd":
                    print ("You got 1 point!")
                else:
                    print("You got zero points, sorry.")
        answer1 = input("Would you like to input another score s or exit e ?")
        if answer1 == ("s"):
            print ("")
        else:
            a=False
1 Like

Is this the entire code?
If so, “nothing” is happening because you are only telling Python that you have this cool function. You don’t tell Python to do anything with it.

You need to actually call the function.
So at the bottom, outside of the function, write scoringsystem()

4 Likes

Hi guys! How much time did you spend learning Python?

Hi @Jake69

Welcome to FCC.

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.