Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Chapter 9 - GUI Programming using Tkinter - Section 9.6 - The Geometry Managers - Check Point - MyProgrammingLab - Page 286: 9.21

Answer

The pack method expects a 'side' argument to be passed in as one of the named constants defined in the tkinter module. However, the code you provided button.pack(LEFT) is passing in LEFT as an argument, which is not defined in the tkinter module. This will result in an AttributeError.

Work Step by Step

To correctly specify the side argument, you need to use the named constant LEFT. So the correct code would be: from tkinter import * button.pack(side=LEFT) This will properly align the button to the left side of the parent window using the pack manager.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.