Question: I am calling a function in a dictionary. In the code below, `select.get` does not work as expected. If `inum = 2`, it will still perform the `login()`.

Any help on finding where is the problem is appreciated!

```
def menu():
    print("Choose\n1.Log in\n2.Exit")
    inum = input()
    select = {
        1: login(),
        2: exit(),
    }
    select.get(inum, menu())

def login():
    guess = ""
    acct = "12345"
    oog = 3
    out = 0
    while guess != acct:
        if oog == out:
            print("no trys left")
            input()
            exit()

        print((str(oog)) + "trys left " + "\nEnter Password here: ")
        guess = input()
        oog = oog - 1

menu()

```

Answer: 
You're not calling the function that the user selected. You're calling both functions immediately, and putting their return values into the dictionary.

And you're calling `menu()` recursively without any termination condition when you call `select.get()`.

You need to put the functions in the dictionary, not their return values. Then call what `select.get()` returns.

And since `input()` returns a string, you need to use strings as the keys in the dictionary.

```
def menu():
    print("Choose\n1.Log in\n2.Exit")
    inum = input()
    select = {
        '1': login,
        '2': exit,
    }
    select.get(inum, menu)()

```
If you want to do something like this, you need to pass references to the functions, not the results of calling the functions. Then you can the functions when the selections is made. For example:

```
def menu():
    inum = input("Choose\n1.Log in\n2.Exit\n")
    select = {
        '1': login,
        '2': exit,
    }

    # decide which function and call it with ()
    select.get(inum, menu)() 

```