config() allows you to set a new value to the property. D correct
The property responsible for storing font information is font.
https://edube.org/learn/pcpp1-4-gui-programming/visiting-widgets-properties-3
However, if you try code from 4 options, only D works correctly:
A, B will raise AttributeError
AttributeError: 'Button' object has no attribute 'setfont'
AttributeError: 'Button' object has no attribute 'ButtonFont'
C has syntax error. C is missing close ")". Also, C is missing "tk.".
If C needs to be correct, it should be:
button = tk.Button(window,font=('Arial', '12', 'italic'))
Since I have to choose 2 answer instead of 1 answer, i prefer CD. Because attribute Error is worse than syntax error.
upvoted 2 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
prabhay786
9 months, 3 weeks agoMoneybing
1 year, 2 months ago