Data Structures and Conditional Statements in Python

0.0(0)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/29

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

30 Terms

1
New cards

IN

Used to CHECK if a value is WITHIN another value.

2
New cards

LISTS

Data structure used for storing all data TYPES; int, float, string, etc. Created using [] square brackets.

3
New cards

APPEND

Adds value to the end of the list.

4
New cards

INSERT

Insert value at a location.

5
New cards

POP

Remove and return the value at the location.

6
New cards

LEN

Returns the TOTAL number of items within a string or list, short for length.

7
New cards

LIST

Converts item to a list.

8
New cards

TUPLES

Just like lists but UNADJUSTABLE.

9
New cards

DICTIONARIES

A hash table, map used for binding keys to values.

10
New cards

KEY

dictionary[key] - GET and SET the value.

11
New cards

DEL

del dict[key] - DELETE a value/key pair.

12
New cards

PYTHON DICTIONARY

Built-in data types in python, mapping object 'maps' value of one object with another.

13
New cards

Union of two dictionary objects

Returning new object.

14
New cards

CONDITIONAL STATEMENTS

Responsible in checking whether the given condition is true/false.

15
New cards

Basic Conditional Statement

if statement.

16
New cards

PYTHON CONDITIONS

Python supports the usual logical conditions from mathematics.

17
New cards

TAB

Python is supersensitive to spacing.

18
New cards

If Statement

Checks if a condition is true.

19
New cards

INDENTATION

Python relies on indentation (whitespace at the beginning of a line) to define scope in the code.

20
New cards

Elif Keyword

The elif keyword is Python's way of saying 'if the previous conditions were not true, then try this condition'.

21
New cards

Else Keyword

Is used when a condition is not satisfied.

22
New cards

Short-hand if-else

A one-liner conditional statement.

23
New cards

Ternary Operators

The use of multiple else statements on the same line.

24
New cards

Nested If Statement

If statements inside if statements.

25
New cards

Nested Else Statement

If statements inside else statements.

26
New cards

Pass Statement

If statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error.

27
New cards

LOGICAL OPERATORS

Operators that combine conditional statements.

28
New cards

And

The and keyword is a logical operator, and is used to combine conditional statements.

29
New cards

Or

The or keyword is a logical operator, and is used to combine conditional statements.

30
New cards

Not

The not keyword is a logical operator, and is used to reverse the result of the conditional statements.