I am trying to make a software but the problem is when I click the button in below code it always shows 9 as output. can anyone suggest solution for this.
from tkinter import *
root = Tk()
frame = Frame(root)
def click(i):
  print(i)
for i in range(10):
    btn = Button(frame,text="Button",command=lambda: click(i))
    btn.pack(...)
root.mainloop()    
 
    