Q:

What will be the output. def f1(x): global x x+=1 print(x) f1(15) print(\"hello\")

0

What will be the output

def f1(x): global x x+=1 print(x) f1(15) print("hello") The code shown above will result in an error because ‘x’ is a global variable. Had it been a local variable, the output would be: 16

  1. error
  2. hello
  3. 16 hello

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Correct Answer:

error

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now