Home
Explore
Exams
Search for anything
Login
Get started
Home
Python Exam 2 Conceptual Review Session
Python Exam 2 Conceptual Review Session
0.0
(0)
Rate it
Studied by 2 people
Learn
Practice Test
Spaced Repetition
Match
Flashcards
Card Sorting
1/32
There's no tags or description
Looks like no tags are added yet.
Study Analytics
All
Learn
Practice Test
Matching
Spaced Repetition
Name
Mastery
Learn
Test
Matching
Spaced
No study sessions yet.
33 Terms
View all (33)
Star these 33
1
New cards
What method can be called on a list to add an item?
.append()
2
New cards
Which datatype is accessed with the .items() method?
dict
3
New cards
What characteristic means that elements can be changed in a datatype?
Mutable
4
New cards
Are tuples indexed?
YES
5
New cards
Which datatype is known to be ordered?
List
6
New cards
What method counts the occurrences of an item in a tuple?
.count(item)
7
New cards
What will myList[0] return if myList = [1,2,3]?
1
8
New cards
Are dictionary keys mutable?
NO
9
New cards
How do you access a value in a dictionary?
By using the key, e.g., myDict[key]
10
New cards
What method can be called on a string to remove whitespace?
.strip(chars)
11
New cards
What does the .split() method do in Python?
Splits a string into a list based on a separator.
12
New cards
What will be the return value of sorted() when a list is passed?
A sorted list without modifying the original.
13
New cards
How do you check if an item is in a list?
Using the 'in' keyword.
14
New cards
What is the primary way to add an item to a list?
.append()
15
New cards
What is the output of the statement myList.reverse()?
None; it modifies the original list.
16
New cards
What occurs if you attempt to call index on a value not found in a list?
An error is thrown.
17
New cards
Are dictionary values mutable?
YES
18
New cards
What does tuple unpacking allow you to do?
Assign variables to values directly from a tuple.
19
New cards
What will 'del myList[0]' do?
Delete the first element of myList.
20
New cards
What does the random module's .random() function return?
A random float between [0,1).
21
New cards
Which method returns the index of an item in a tuple?
.index(item)
22
New cards
What happens in tuple packing?
Values are packed into the tuple.
23
New cards
How are dictionaries used to count letter occurrences?
By incrementing the count for each letter in a looping structure.
24
New cards
What is the significance of using the import statement before a module?
It allows access to the functions and variables defined in that module.
25
New cards
What happens when you try to add duplicate keys to a dictionary?
Only the last assignment to the key will be kept.
26
New cards
What is unique about the elements in a dictionary?
Keys must be unique.
27
New cards
What is a key characteristic of lists in Python?
They are mutable.
28
New cards
What will myTuple[0] return if myTuple = (1,2,3)?
1
29
New cards
What does the range function return?
A sequence of numbers in a specified range.
30
New cards
To mutate items in a tuple, what must be done?
You must create a new tuple.
31
New cards
What is the purpose of the .replace() method in strings?
To return a new string with specified substrings replaced.
32
New cards
What are the characteristics of a dictionary?
Keys are unique and values can be mutable.
33
New cards
How to check if two items are identical?
Use '==' operator.
Explore top notes
Power of Electrical Appliances
Updated 994d ago
Note
Preview
How do we study smart thinking?
Updated 999d ago
Note
Preview
Unit 2 Molecular Energy
Updated 954d ago
Note
Preview
Chapter 11 - Nelson Science 10
Updated 808d ago
Note
Preview
Ear Functions PLTW MI, 1.3
Updated 258d ago
Note
Preview
english units 6-9
Updated 132d ago
Note
Preview
AP World Guide: Unit 6
Updated 64d ago
Note
Preview
AP World History - Unit 9: Globalization
Updated 817d ago
Note
Preview
Explore top flashcards
Bio Unit 4 & 5 Flashcards
Updated 179d ago
Flashcards (55)
Preview
ETS RC 2023 - TEST 03 PART 5
Updated 627d ago
Flashcards (72)
Preview
Spanish Vocab
Updated 517d ago
Flashcards (52)
Preview
Digestive System Test
Updated 115d ago
Flashcards (82)
Preview
Psychology Exam 9
Updated 451d ago
Flashcards (100)
Preview
Micro Lecture 14 - Molecular Info Flow: Replication
Updated 458d ago
Flashcards (84)
Preview
Unit 2: Interactions Among Branches of Government
Updated 225d ago
Flashcards (21)
Preview
AP Chinese Ultimate Guide
Updated 826d ago
Flashcards (721)
Preview