Study Guide + Exam Questions &
Solutions Graded A+
Professional Academic Assistance Services
Services Offered
• Proctored Exam Assistance
• Online Class Management (Full Course Support)
• Exam Preparation & Study Materials
• Assignments and Coursework Support
• Essay and Research Paper Writing
• Discussion Posts & Responses
• Editing and Proofreading
• Confidential Academic Consultation
Contact Information
Email:
WhatsApp link: https://wa.me/254704846336
Fast Response | Confidential | Reliable Academic
Support
Helping Students Achieve Academic Excellence
, What will the following print?
L1 = [ 1, 2, 3, 4, 5 ]
L1[ : : - 1 ] = [ 1, 2, 3, 4, 5 ]
print(L1) - Answer: [ 5, 4, 3, 2, 1 ]
What will the following print?
L = [ 1,2,3 ]
def D( ):
L = [ 'a','b' ]
def E( ):
nonlocal L
L[ 1 ] = 'hi'
E( )
D( )
print(L) - Answer: [ 1, 2, 3 ]
What does the optional third argument of reduce do? - Answer:
It is an initializer, like the base in Haskel.
Ex: reduce(lambda x,y: x+y, [1,2,3], 0) will evaluate as (((0+1)
+2) +3) instead of using the first two elements in the list for the