QuestionQ27

VerifiedPython Basics

Which of the following commands would fix the error shown below?

Question Image

Explanation

itertools is a standard-library module, but it must be imported before code can reference itertools.compress. Adding import itertools defines that module name and resolves the NameError.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!