I have a legit situation like this where I need to implement a method that changes the incoming object itself (convert list into dict)
def f(l): # f is a function that receives a list as input
pass # Implement this
x = ['Hello', 'World']
f(x)
print(x) # x is now a dict {'hello':'world'}
How will you implement the above f() ?
The key thing is upon calling f() the incoming object itself must be mutated into different type.
Note: Genuine answers welcome instead of questioning the situation.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)