❔ Interview question
What is the output of the following code?
Answer:
<class 'tuple'>
tags: #python #interview #coding #programming #function #returnvalues #tuple #dev
By: t.iss.one/DataScienceQ 🚀
What is the output of the following code?
def my_func():
return "hello", "world"
result = my_func()
print(type(result))
Answer:
tags: #python #interview #coding #programming #function #returnvalues #tuple #dev
By: t.iss.one/DataScienceQ 🚀
❔ Interview question
What is the output of the following code?
Answer:
15
tags: #python #advanced #coding #programming #interview #nonlocal #function #dev
By: t.iss.one/DataScienceQ 🚀
What is the output of the following code?
def outer():
x = 10
def inner():
nonlocal x
x += 5
return x
return inner()
result = outer()
print(result)
Answer:
tags: #python #advanced #coding #programming #interview #nonlocal #function #dev
By: t.iss.one/DataScienceQ 🚀