Free Online Flashcard Deck

2 Programming Foundations for Data Analysis Free Online FlashCards

Study 2 Programming Foundations for Data Analysis with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

What is a Python variable, and what does = do?

Back

A variable is a name associated with a value; Python’s = assigns a value to a name rather than testing mathematical equality.

02
Front

When does Python determine a value’s type?

Back

Python determines a value’s type at runtime. Converting numeric text with float(), for example, can make it usable as a decimal number.

03
Front

What is a Python list suited for?

Back

A list is an ordered, changeable sequence, useful for storing observations or measurements.

04
Front

How do if, elif, and else divide conditional cases?

Back

Use if for the first test, elif for additional possibilities, and else for the remaining case. Each controls its indented block.

05
Front

How does a for loop process a collection?

Back

A for loop processes items in a collection in turn; its loop variable takes the next item on each pass.

06
Front

What are the roles of def, parameters, and return in a function?

Back

A function is a named, reusable block of code. Define it with def, use parameters for inputs, and return to send a result to the caller.

07
Front

How does a tuple differ from a list?

Back

A tuple is an ordered, unchangeable sequence, useful for a fixed group of related values.

08
Front

How can a dictionary safely handle a possibly missing key?

Back

A dictionary stores key–value pairs. Its get() method can return a default value when a key is absent, avoiding a KeyError.

09
Front

When is a set useful?

Back

A set stores distinct values, making it useful when duplicates are not needed.

10
Front

What index refers to the first item in a Python list?

Back

Python list indexes start at zero, so readings[0] refers to the first item.

11
Front

Which Python operators combine or reverse logical tests?

Back

Use and, or, and not to combine or reverse logical tests in a condition.

12
Front

When does a while loop repeat?

Back

A while loop repeats its code as long as its condition remains true.