CMP 104 Chapter 4

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

The _____ at the end of a for statement tells Python to interpret the next line as the start of a loop.

Colon

You cannot ever modify or assign a new value to a variable that holds a tuple.

False

When the syntax is valid Python code, but the code does not produce the desired result, it is called a _______. Selected Answ

Logical error

A tuple looks just like a list except you use ______ instead of square brackets.

Parenthesis

The ______ function causes Python to start counting at the first value you give it, and it stops when it reaches the second value.

Range ()

A list comprehension combines the for loop and the creation of new elements into one line, and automatically appends each new element.

True

Always indent the line after the for statement in a loop.

True

Python refers to values that cannot change as immutable, and an immutable list is called a ____.

Tuple

When you want to do the same action with every item in a list, you can use Python's ____loop.

for

You can loop all over the values in a tuple using a _____ loop, just as you did with a list.

for


Kaugnay na mga set ng pag-aaral

Khan Academy- Compsci Principles: Simulations

View Set

DEF System - Diesel Exhaust Fluid

View Set

CH: 4 Patient Rights & Legal Issues

View Set

Impact of Changes on a DCF and WACC

View Set

Chapter 1-3 Pearson Dynamic Study Set

View Set

Cardiac PrepU Questions (Exam #3)

View Set

Evolution: quick or progressive?

View Set

Physical Geology - Online Lab Quiz 10

View Set