Free Online Flashcard Deck

02. Variables, Data Types, and Input–Output Free Online FlashCards

Study 02. Variables, Data Types, and Input–Output with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

What is a variable?

Back

A variable is a named reference to a value, allowing a program to store information and use it later.

02
Front

What naming convention uses underscores between words?

Back

snake_case separates words with underscores, as in maximum_speed.

03
Front

What rules apply to Python identifiers?

Back

Python identifiers may contain letters, digits, and underscores, but cannot begin with a digit, use reserved keywords, or ignore case differences.

04
Front

Which Python operator performs assignment?

Back

The single equals sign (`=`) assigns the evaluated result on the right to the name on the left.

05
Front

Which operator tests equality in Python?

Back

The double equals operator (`==`) compares values and asks whether they are equal; it does not assign a value.

06
Front

How does Python conventionally represent constants?

Back

Python does not enforce constants directly. Programmers conventionally use uppercase names, such as DAYS_PER_WEEK, for values that should not change.

07
Front

Which Python type represents whole numbers?

Back

`int` represents an integer, or whole number, such as -4, 0, or 27.

08
Front

Which Python type represents True or False?

Back

`bool` represents a Boolean logical value: `True` or `False`.

09
Front

What does a data type determine?

Back

A data type describes the kind of value stored and the operations that can be performed on it.

10
Front

Which function converts a value to an integer?

Back

`int()` converts a value to an integer when possible, such as `int("42")`, which produces 42.

11
Front

What type does Python input() return?

Back

Python’s `input()` function returns the user’s entry as a string, even when the entry consists of digits.

12
Front

What does Python’s print() function do?

Back

`print()` writes values to standard output, such as the screen. It can display one or several values.