AppendixCheckpoint Answers

Chapter 4

Which of the following variable names cannot be used in Python?

Answer: B

Naomi wants to print the value of the movie_title variable; however, the value assigned needs to be fixed. Which option correctly assigns the movie title Toy Story 4 to the variable movie_title?

Answer: C

When Naomi tries to print the description variable, she gets an error. What is wrong with the description variable?

Answer: D

If Harrison prints the current_location variable, which location will be printed?

Answer: A

Chapter 5

(2 × 3) + 72

Answer: 55

72 / 8

Answer: 9.0

33 / 2 + 32

Answer: 22.5

(5 + 10) + (9 × 5) − 12

Answer: 48

Chapter 6

Javier put together a list of his 50 favorite songs of all time. However, he copied and pasted the titles from the internet, which resulted in various title formats. Some titles are in all caps, while some are all lowercase. Javier wants to reformat the list so that the first letter in each word of the song is capitalized. Which string method should Javier use?

Answer: D

Chapter 8

Jared wants to create a list of his favorite superheroes. Which list demonstrates the proper syntax for his list?

Answer: C

What is the item at index [-2] in the list books?

Answer: D

Claudia's list looks to be a bit too long. Which function can she use to get the length of her list?

Answer: A

Since Claudia's list is too long, she needs to remove an item from the list presents. She has decided to remove the basketball since she already has ...

Get Bite-Size Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.