File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 11import tkinter as tk
22from itertools import permutations
33
4+
45def find_anagrams ():
56 a = entry .get ().strip ().lower ()
6-
7+
78 if a :
89 b = a .split ()
910 c = []
1011 for d in b :
1112 e = ["" .join (f ) for f in permutations (d )]
1213 c .extend (e )
13-
14+
1415 y .set (", " .join (c ))
1516 else :
1617 y .set ("Please enter a valid string." )
1718
19+
1820app = tk .Tk ()
1921app .title ("Anagram Finder" )
2022
@@ -34,9 +36,9 @@ def find_anagrams():
3436result_label = tk .Label (frame , textvariable = y , wraplength = 300 )
3537result_label .grid (row = 1 , columnspan = 3 , pady = 10 )
3638
37- frame .config (bg = "#333" )
38- label .config (fg = "white" )
39- entry .config (bg = "gray" , fg = "white" )
40- find_button .config (bg = "gray" , fg = "white" )
41- result_label .config (bg = "#333" , fg = "white" )
39+ frame .config (bg = "#333" )
40+ label .config (fg = "white" )
41+ entry .config (bg = "gray" , fg = "white" )
42+ find_button .config (bg = "gray" , fg = "white" )
43+ result_label .config (bg = "#333" , fg = "white" )
4244app .mainloop ()
You can’t perform that action at this time.
0 commit comments