What will be the output of the following Python code?
def f1(): x=15 print(x) x=12 f1()
def f1(): x=100 print(x) x=+1 f1()
def san(x): print(x+1) x=-2 x=4 san(12)
def f1(): global x x+=1 print(x) x=12 print("x")
def f1(x): global x x+=1 print(x) f1(15) print("hello")
def f1(a,b=[]): b.append(a) return b print(f1(2,[3,4]))
निम्नलिखित Python कोड का आउटपुट क्या होगा?
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)
x = 5 def f1(): global x x = 4 def f2(a,b): global x return a+b+x f1() total = f2(1,2) print(total)
x=100 def f1(): global x x=90 def f2(): global x x=80 print(x)
Read the following Python code carefully and point out the global variables?
y, z = 1, 2 def f(): global x x = y+z
x=1 def cg(): global x x=x+1 cg() x
a=10 globals()['a']=25 print(a)
def f(): x=4 x=1 f() x
Fill in the line of the following Python code for calculating the factorial of a number.
def fact(num): if num == 0: return 1 else: return _____________________
def test(i,j): if(i==0): return j else: return test(i-1,i+j) print(test(4,7))
l=[] def convert(b): if(b==0): return l dig=b%2 l.append(dig) convert(b//2) convert(6) l.reverse() for i in l: print(i,end="")