1. import tkinter as tk
2.
3. def change_color(event):
4. event.widget.configure(bg="red")
5.
6. root = tk.Tk()
7. label = tk.Label(root, text="Click me!")
8. label.bind("
9. label.pack()
10.
11. root.mainloop()
What will happen when you click on the label?
1. class BaseClass:
2. pass
3.
4. class DerivedClass(BaseClass):
5. pass
6.
7. print(DerivedClass.__bases__)
What is the __bases__ special attribute for?
def process_data(*args, **kwargs):
if "mode" in kwargs:
mode = kwargs['mode']
if mode == 'sum':
result = sum(args)
elif mode == 'product':
result = 1
for arg in args:
result *= arg
else:
result = None
else:
result = None
return result
Which of the following function calls will correctly compute the product of the given numbers?
© Copyrights Dumpscity 2024. All Rights Reserved
We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the Dumpscity.