Tag: Local

  • Python Questions and Answers – Global vs Local Variables – 1

    Python Questions and Answers – Global vs Local Variables – 1

    Python Multiple Choice Questions & Answers (MCQs) focuses on “Global vs Local Variables – 1”. Q 1. What will be the output of the following Python code? def f1():x=15print(x)x=12f1()A. 10B. 12C. 15D. Error Show Answer Answer:-C. 15 Explanation In the code shown above, x=15 is a local variable whereas x=12 is a global variable. Preference…

You cannot copy content of this page