File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 1
1
import tkinter as tk
2
2
from itertools import permutations
3
3
4
+
4
5
def find_anagrams ():
5
6
a = entry .get ().strip ().lower ()
6
-
7
+
7
8
if a :
8
9
b = a .split ()
9
10
c = []
10
11
for d in b :
11
12
e = ["" .join (f ) for f in permutations (d )]
12
13
c .extend (e )
13
-
14
+
14
15
y .set (", " .join (c ))
15
16
else :
16
17
y .set ("Please enter a valid string." )
17
18
19
+
18
20
app = tk .Tk ()
19
21
app .title ("Anagram Finder" )
20
22
@@ -34,9 +36,9 @@ def find_anagrams():
34
36
result_label = tk .Label (frame , textvariable = y , wraplength = 300 )
35
37
result_label .grid (row = 1 , columnspan = 3 , pady = 10 )
36
38
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" )
42
44
app .mainloop ()
You can’t perform that action at this time.
0 commit comments