What is the output of the following code?

Category: PythonWhat is the output of the following code?
Editor">Editor Staff asked 2 years ago

What is the output of the following code?

v = ‘Hello’
def f():
v = ‘World’
return v
print(f())
print(v)

a)
World
World
b)
Hello
Hello
c)
World
Hello
d)
Hello
World

1 Answers
Editor">Editor Staff answered 2 years ago

Correct answer is
c)
World
Hello