Certified Professional in Python Programming (PCPP-32-101) — Question 38
What is true about the invocation of the cget() method?
Answer options
- A. It can be used to read widget attributes
- B. It has the same effect as the config() method
- C. It can be used to set new values to widget attributes
- D. It can be replaced with a dictionary-like access manner
Correct answer: A
Explanation
The cget() method is specifically designed to retrieve the current value of a widget's attribute, which makes option A the correct answer. Options B and C are incorrect because they do not accurately describe the cget() method's functionality, and option D, while true in a broader context, does not directly apply to the cget() method.