PCPP1 Graphical User Interface Programming Practice Question
When using the pack geometry manager, you want a widget to fill the available space in the parent container. Which argument for the 'fill' parameter should you use to make it expand in both horizontal and vertical directions?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
fill=tk.BOTH
The 'BOTH' constant from the tkinter module is used with the fill parameter to expand in both dimensions.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
fill=tk.BOTH
Why this is correct
tk.BOTH is the correct constant for filling both directions.
- ✗
fill='all'
Why it's wrong here
The 'all' string is not a valid parameter for fill.
- ✗
fill='both'
Why it's wrong here
Tkinter expects the constant tk.BOTH, not a lowercased string.
- ✗
fill=tk.EXPAND
Why it's wrong here
tk.EXPAND is used for the expand parameter, not fill.
About these practice questions
This PCPP1 question is part of Courseiva's 209-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Python Institute exam blueprint
This PCPP1 practice question is part of Courseiva's free Python Institute certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCPP1 exam.