質問編集履歴

1

ソースコードを書きました。すみませんでした。よろしくお願いします。

2022/07/21 22:48

投稿

haru0
haru0

スコア5

test CHANGED
File without changes
test CHANGED
@@ -16,15 +16,75 @@
16
16
 
17
17
  ### 該当のソースコード
18
18
 
19
- ```ここに言語名を入力
19
+ python
20
+
20
21
  ソースコード
22
+
23
+ import sympy as sym
24
+
25
+ a, b, c, x = sym.symbols("a b c x")
26
+ eq = sym.Eq(a * x ** 2 + b * x + c)
27
+ sym.solve(eq, x)
28
+
29
+ -----------------------------------
30
+
31
+ from tkinter import *
32
+ from tkinter import ttk
33
+ from tkinter import messagebox as mb
34
+
35
+ root = Tk()
36
+ root.title("Quadratic Equations Calculator")
37
+ root.geometry('400x400')
38
+
39
+ la1 = ttk.Label(root, text ='ax^2 + bx + c = 0')
21
- ```
40
+ la1.pack()
41
+
42
+ la2 = ttk.Label(root, text ='Enter values for a, b and c:')
43
+ la2.pack()
44
+
45
+ la3 = ttk.Label(root, text ='a =')
46
+ la3.pack()
47
+ en3 = ttk.Entry(root)
48
+ en3.pack()
49
+
50
+ la4 = ttk.Label(root, text ='b =')
51
+ la4.pack()
52
+ en4 = ttk.Entry(root)
53
+ en4.pack()
54
+
55
+ la5 = ttk.Label(root, text ='c =')
56
+ la5.pack()
57
+ en5 = ttk.Entry(root)
58
+ en5.pack()
59
+
60
+
61
+ computebutton = ttk.Button(root, text ='Compute')
62
+ computebutton.pack()
63
+
64
+
65
+ def help_button():
66
+ mb.showinfo('Help', 'You can only enter integers.')
67
+
68
+ helpbu = ttk.Button(root, text ='Help', command = help_button)
69
+ helpbu.pack()
70
+
71
+
72
+ def quit_button():
73
+ root.destroy()
74
+
75
+ quitbu = ttk.Button(root, text ='Quit', command = quit_button)
76
+ quitbu.pack()
77
+
78
+
79
+ root.mainloop()
22
80
 
23
81
  ### 試したこと
24
82
 
25
- 問題に対して試した記載しください。
83
+ お恥ずかしいにこの先何すればいいのか全く分かりません。完全に詰まっていますすみません。
26
84
 
27
85
  ### 補足情報(FW/ツールのバージョンなど)
28
86
 
29
87
  ここにより詳細な情報を記載してください。
30
88
 
89
+
90
+