import random import tkinter as tk def generaterandomnumber(): randomnumber =…
Jump to turn (11)
- 1import random import tkinter as tk def generaterandomnumber(): randomnumber = ra
- 2listen noob i copy paste it haha i get this error ! File "main.py", line 6 resul
- 3and again : File "main.py", line 6 resultlabel.config(text=f"Random number is {r
- 4File "main.py", line 6 resultlabel.config(text=f"Random number is {randomnumber}
- 5File "main.py", line 6 resultlabel.config(text=f"Random number is {randomnumber}
- 6File "main.py", line 9 root.title(“Random Number Generator”) ^ SyntaxError: inva
- 7do me a code python again : just something impress me
- 8i got error : File "main.py", line 5 “”“Returns the Mandelbrot set”“” ^ SyntaxEr
- 9pls remove all that ”“” symbosl if u can ?
- 10chacne to work like 1 % haha !
- 11File "main.py", line 5 “”“Returns the Mandelbrot set”“” ^ SyntaxError: invalid c
- User
import random import tkinter as tk
def generate_random_number(): random_number = random.randint(1, 10) result_label.config(text=f"Random number is {random_number}“)
root = tk.Tk() root.title(“Random Number Generator”)
generate_button = tk.Button(root, text=“Generate Random Number”, command=generate_random_number) generate_button.pack(pady=10)
result_label = tk.Label(root, text=”") result_label.pack()
root.mainloop() u just did thta doe but its not working
- Assistant
I am sorry to hear that the code is not working.
Here are some common issues that may cause the code to fail:
-
Incorrect syntax: Make sure the quotation marks and parentheses are all correct and every line ends with a colon.
-