Python and Pandas for Data Engineering Week2

.docx

School

Grand Rapids Community College *

*We aren’t endorsed by this school

Course

247

Subject

Computer Science

Date

Dec 6, 2023

Type

docx

Pages

3

Uploaded by ConstableWildcatMaster401

Report
Congratulations! You passed! Grade received 87.50% Latest Submission Grade 87.50% To pass 80% or higher Go to next item 1. Question 1 What does a list comprehension return? 1 / 1 point A list A single value Multiple values Correct Yes, this is true. 2. Question 2 Which type of compound statement does a list comprehension generally replace? 1 / 1 point if statement while-loop for-loop Correct Yes, a list comprehension replaces a for loop which populates a list. 3. Question 3 What is the result of 'string' == "string" ? 1 / 1 point True False Correct Yes, single and double quotes are evquivalent. 4. Question 4 What is the result of 'string' == "String" ? 1 / 1 point False True Correct Yes, they are not equal. 5. Question 5 Select all answers that reflect the differences between lists and tuples. 0.75 / 1 point Lists are mutable and tuples are immutable Correct Yes, tuples cannot be changed once they are created. Items can be added to lists, but not tuples. Lists are unlimited and tuples are capped. Tuples can be used as keys in a dictionary, lists cannot. Correct You didn’t select all the correct answers
6. Question 6 What is the output of list(range(16, 0, -5)) ? 1 / 1 point [15, 10, 5, 0] [1, 6, 11, 16] [16, 11, 6, 1] Correct Yes, this is correct. 7. Question 7 One advantage of using range objects instead of lists when dealing with large number ranges is 1 / 1 point It is faster to add numbers to a range object. The range object works with the len() function. The range object has a small memory footprint no matter the range. Correct Yes, this is true. 8. Question 8 If you change keys or values in a dictionary after accessing dictionary views, the views will 0 / 1 point Dynamically update to reflect the changes. Require manual refresh to reflect the changes. Reflect the initial keys and values with the changes. Incorrect No, no manual intervention is required. 9. Question 9 1 2 3 4 5 6 7 def count_gen(): i = 1 while True : yield i i += 1 count = count_gen() What type of object is count ? 1 / 1 point A generator A integer A function Correct Yes, this is correct.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help