Question: I have a link that is placed in `li` and when you hover on it, a block should appear with links that I will indicate in it

```
<li id="dropdown" class="li">
    <a href="/news/">Lessons</a>
</li>
<div class="dropdown-content">
    <a href="#">Link 1</a>
    <a href="#">Link 2</a>
    <a href="#">Link 3</a>
</div>

```

Answer: 
In this case, you don't have to declare `global`. Simply indent your `submitBtn` function inside `entry_Fn`:

```
def entry_Fn():
    level_1 = Toplevel(root)
    Label( level_1, text = "level one").pack()
    entry_1 = Entry(level_1)
    entry_1.pack()
    entry_2 = Entry(level_1)
    entry_2.pack()
    def submitBtn():
        val_1= entry_1.get()
        val_2= entry_2.get()
        sum_var.set(int(val_1)+ int(val_2))
        level_1.destroy()
    Button(level_1, text= "submit", command=submitBtn).pack()

```

But generally it is easier to make a class so you can avoid this kind of scope problems, like below:

```
from tkinter import *

class GUI(Tk):
    def __init__(self):
        super().__init__()
        self.geometry('600x400')
        self.sum_var= StringVar()
        Label(self, text="Main window").pack()
        Button(self, text="To enter Data", command=self.entry_Fn).pack()
        sum = Label(self, textvariable=self.sum_var)
        sum.pack()

    def entry_Fn(self):
        self.level_1 = Toplevel(self)
        Label(self.level_1, text = "level one").pack()
        self.entry_1 = Entry(self.level_1)
        self.entry_1.pack()
        self.entry_2 = Entry(self.level_1)
        self.entry_2.pack()
        Button(self.level_1, text="submit", command=self.submitBtn).pack()

    def submitBtn(self):
        val_1 = self.entry_1.get()
        val_2 = self.entry_2.get()
        self.sum_var.set(int(val_1)+ int(val_2))
        self.level_1.destroy()

root = GUI()

root.mainloop()

```
For your case, you can simply pass the two entries to `submitBtn()` function:

```
def submitBtn(entry_1, entry_2):
    ....

```

Then update the `command=` for the submit button inside `entry_Fn()`:

```
Button(level_1, text="submit", command=lambda: submitBtn(entry_1, enter_2)).pack()

```