Review Flashcards
(42 cards)
What’s an integer?
A complete number (EX. 5)
What’s a float?
An un-complete number (EX. 5.5)
What’s a string?
Sequence of characters
Are strings mutable or immutable?
Immutable
Booleans: What does “and” do?
Evaluates if all provided statements are true
Booleans: What does “or” do?
Evaluates if at least one of many statements are true
Booleans: What does “not” do?
Flips the bool value
What are lists?
A data structure for mutable ordered sequences of elements
Are lists mutable or immutable?
Mutable
Are lists ordered?
Yes
How are lists defined? (What starts and ends the sequence?)
[]
What does mutability mean?
Whether an object can change it’s values after it has been created
What does order mean?
Whether the order of elements in a sequence matters (and whether this can be used to access elements)
Are strings ordered?
Yes
Why is ordering helpful?
Because indexing works well
What does print() do?
Writes text
What does len() do?
Returns the length of a sequence
Does len() return the index length or intuitive numbers?
Intuitive
What is this an example of? ___[1]
indexing
What is this an example of? ___[1:4]
Slicing
What does type() do?
Tells you if it’s a str, int, float
What does \n do?
Starts a new line
Dictionaries: Can they be indexed? If so, how?
Yes, through the use of keys
Dictionaries: Are they mutable?
Yes