title: Get the number of Toplevel windows in tkinter
body: <p>Is there any way to get the number of toplevel windows in tkinter?</p>
  <p>Here's the code:</p>
  <pre><code>from tkinter import *
  
  root = Tk()
  root.geometry(&quot;500x500&quot;)
  
  def get_number_of_toplevel_windows():
      # Code to count the number of toplevel windows
      pass
  
  toplevel_1 = Toplevel(root)
  toplevel_2 = Toplevel(root)
  toplevel_3 = Toplevel(root)
  
  get_button = Button(root , text = &quot;Get number of toplevel windows&quot; , command = get_number_of_toplevel_windows)
  get_button.pack()
  
  mainloop()
  </code></pre>
  <p>Here when I click on the <code>get_button</code>, I want to print the number of toplevel windows (three in this case.).</p>
  <p>Is there any way to achieve this in tkinter?</p>
  <p>It would be great if anyone could help me out.</p>