Exam 4: Introducing the Python Collections: Lists, Dictionaries, Tuples, and Statistics
Exam 1: Introduction to Python: Introduction to Numeric Types, Turtle Graphics, Simple for Loops and Functions34 Questions
Exam 2: Pthon: Estimating PI: Math and Random Methods, Selection and Boolean Expressions, the Print Function33 Questions
Exam 3: Codes and Other Secrets: String Operators and Methods, the Len Built-In Function, Keyword Parameters, User Input33 Questions
Exam 4: Introducing the Python Collections: Lists, Dictionaries, Tuples, and Statistics33 Questions
Exam 5: Bigger Data: File Io: the While Loop, String Formatting, Reading Online Data in CSV and Json Formats33 Questions
Exam 6: Image Processing: Nested for Loops, Functions As Parameters, Namespaces, Lists of Lists33 Questions
Exam 7: Data Mining: Cluster Analysis: More on the While Loop; Parrallel Lists31 Questions
Exam 8: Cryptanalysis: Advanced Dictionaries and Lists, Regular Expressions32 Questions
Exam 9: Fractals: the Geometry of Nature: Recursion, Grammars and Production Rules33 Questions
Exam 10: Astronomy: Creating Classes, Writing Constructors, Accessors, Mutators and Special Methods33 Questions
Exam 11: Simulation:computer Simulation Using Objects34 Questions
Exam 12: Father Was a Rectangle: Inheritance and Object-Oriented Design32 Questions
Exam 13: Video Games: Multithreading, Event Handlers, Static Variables33 Questions
Select questions type
Case Study 2:
>>> changeList = [1, 2, "buckle my shoe", 3, 4,
"shut the door"]
2. >>> changeList
3. [1, 2, 'buckle my shoe', 3, 4, 'shut the door']
4. >>> changeList[2] = "the sky is blue"
5. >>> changeList
6. ??????
7. >>> name = "Monte"
8. >>> name[2] = "x"
9. ??????
-Refer to the session in the accompanying Case Study 2. What will be the output on line 6?
(Multiple Choice)
4.8/5
(38)
What will be the output based on the following lines of code?
>>> myList = [3, "cat", 6.5, 2]
>>> myList
(Multiple Choice)
4.8/5
(36)
Case Study 1:
1. >>> m
2. >>> ??????
3. print(answer)
Output:
A
B
E
A
D
B
B
A
C
E
-Refer to the session in the accompanying Case Study 1. What program statements appear on line 2 to create the output listed in the case study?
(Multiple Choice)
4.8/5
(31)
Case Study 3:
>>> ages = {'David':45, 'Brenda':46}
>>> ages
{'David': 45, 'Brenda': 46}
>>>
-Refer to the session in the accompanying Case Study 3. What will be the output after the following statement?
>>> ages['David']
(Multiple Choice)
4.8/5
(42)
The ____ list function removes and returns the last item in a list.
(Multiple Choice)
4.9/5
(32)
What method is used to retrieve the value from a dictionary associated with a given key?
(Multiple Choice)
4.7/5
(44)
An interesting question arises when we consider what would happen if we did not have a built-in function to return the maximum value in the list. We could conceivably construct our own getMax function by iterating through the items in the list and keeping track of the largest value that we encounter. Provide an implementation of such a function.
(Essay)
4.9/5
(31)
Describe the use of the split method for lists and provide an example of its use.
(Essay)
4.9/5
(39)
Strings are mutable collections of data in which individual items within the string cannot be changed.
(True/False)
4.9/5
(33)
The values() method returns a dict_values object that behaves much like a list of the values in a dictionary.
(True/False)
4.8/5
(33)
What statement is used to remove an entry from a dictionary based on a given key?
(Multiple Choice)
4.7/5
(33)
Python provides the ____ function to create a list from a range or string.
(Multiple Choice)
4.8/5
(43)
Showing 21 - 33 of 33
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)