Python Fundamentals - Data Types, Operators, and Control Flow

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/21

flashcard set

Earn XP

Description and Tags

Flashcards covering Python data types, numeric types, boolean evaluation, various operator groups, collection types (Lists, Tuples, Sets, Dictionaries), and conditional control flow.

Last updated 3:56 AM on 7/28/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

22 Terms

1
New cards

What function is used to get the data type of an object in Python?

The type() function (e.g., print(type(x))).

2
New cards

What are the three built-in numeric types in Python?

int, float, and complex.

3
New cards

How is an integer (intint) defined in Python?

A whole number, positive or negative, without decimals, of unlimited length.

4
New cards

What is a floatfloat, or "floating point number"?

A number, positive or negative, containing one or more decimals.

5
New cards

How are complex numbers written in Python?

With a jj as the imaginary part (e.g., 3+5j3+5j).

6
New cards

What function is used to evaluate any value and return TrueTrue or FalseFalse?

The bool() function.

7
New cards

What does the arithmetic operator //// represent?

Floor division.

8
New cards

What does the arithmetic operator ** represent?

Exponentiation.

9
New cards

What are the two identity operators in Python?

isis and isnotis\,not.

10
New cards

What is the purpose of membership operators like inin and notinnot\,in?

They are used to test if a sequence is presented in an object.

11
New cards

What does the bitwise operator ^ represent?

XOR (Sets each bit to 11 if only one of two bits is 11).

12
New cards

According to operator precedence, which operator is at the very top of the hierarchy?

Parentheses ()().

13
New cards

In Python, what brackets are used to create a List?

Square brackets [][].

14
New cards

What are the three defining characteristics of List items?

They are ordered, changeable, and allow duplicate values.

15
New cards

Which function is used to determine the number of items in a list?

The len() function.

16
New cards

Define the characteristic of a Tuple.

A collection which is ordered and unchangeable, and allows duplicate members.

17
New cards

Define the characteristic of a Set.

A collection which is unordered, unchangeable*, and unindexed, with no duplicate members.

18
New cards

Define the characteristic of a Dictionary.

A collection which is ordered** and changeable, with no duplicate members.

19
New cards

What does Python rely on to define scope in the code?

Indentation (whitespace at the beginning of a line).

20
New cards

What keyword is used in Python to catch anything not caught by preceding conditions in an ifif statement?

The elseelse keyword.

21
New cards

What is a "nested if" statement?

An ifif statement inside another ifif statement.

22
New cards

What statement is used to avoid an error if an ifif statement has no content?

The passpass statement.