Report Bug

Qus

What will be the output of the following Python code?

def f(p, q, r):      global s      p = 10      q = 20      r = 30      s = 40      print(p,q,r,s)  p,q,r,s = 1,2,3,4  f(5,10,15)
Qusनिम्नलिखित Python कोड का आउटपुट क्या होगा?


A. 1 2 3 4
B. 5 10 15 4
C. 10 20 30 40
D. 5 10 15 40


Solution
C. 10 20 30 40



Explanation
The above code shows a combination of local and global variables. The output of this code is: 10 20 30 40
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad