Report Bug

Qus

What will be the output of the following Python code?

def power(x, y=2):
    r=1
    for i in range(y):
        r=r*x
    return r
print(power(3))
print(power(3,3))
(A)  212
      32
(B) 9
      27
(C) 567
      98
(D) None of the above
Qus

निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

def power(x, y=2):
    r=1
    for i in range(y):
        r=r*x
    return r
print(power(3))
print(power(3,3))

(A)   212
       32
(B)  9
      27
(C)  567
      98
(D) None of the above


A. Option A
B. Option B
C. Option C
D. Option D


Solution
B. Option B



CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz