Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1entry = tk.Entry(root) | AThe brackets are missing, so this stores the method itself instead of calling it. It should be entry.get() | |
| 2name = entry.get() | Bentry.delete(0, tk.END) | |
| 3Clear the text box by deleting every character from the first position to the end | CCreates a text box inside the window called root and stores it in the variable entry | |
| 4The text from an Entry is a string, so convert it to an integer before doing arithmetic | DReads the text the user typed in the text box and stores it as a string in name | |
| 5total = entry.get() + 10 | Eget() returns a string, so adding the number 10 causes a TypeError. Convert first: total = int(entry.get()) + 10 | |
| 6text = entry.get | Fage = int(entry.get()) |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
entry = tk.Entry(root) — Creates a text box in the window. Call entry.get() to read what the user typed. It is always a string, so convert it with int() or float() to use it as a number.entry = tk.Entry(root)name = entry.get()entry.delete(0, tk.END)entry.delete(0, tk.END)text = entry.get()
price = float(text)