O Level - Functions In Python
Questions No: 1/50

find the output of following code:

def add(a,b):
    return(a+b)
print(add(3,4))

Questions No: 2/50

What is the output of the following code?

x = 50
def func (x):
    x = 2
func (x)
print ('x is now', x)

Questions No: 3/50

Which of these is false about recursion?
इनमें से कौन सी पुनरावृत्ति के बारे में गलत है?

Questions No: 4/50

Which one of the following is incorrect?
निम्नलिखित में से कौन सा गलत है?

Questions No: 5/50

Which of the following function headers is correct ?
निम्नलिखित में से कौन सा फंक्शन हेडर सही है?

Questions No: 6/50

What is the output of the following code ?

def add(a, b):
       return a+5, b+5
result = add(3,2)
print(result)

Questions No: 7/50

What is the output of this code?

def calc(x):
       r=2*x**2
       return r
print(calc(5))

Questions No: 8/50

Debugging is the process of fixing a______in the software.
डिबगिंग सॉफ्टवेयर में ______ को ठीक करने की प्रक्रिया है।

Questions No: 9/50

What is the output of the following

y='klmn'
for i in range(len(y)):
    print(y)

Questions No: 10/50

What is the output of the following code ?

def disp(*arg):
    for i in arg:
        print(i)
disp(name="Rajat", age="20")

Questions No: 11/50

____ are the arguments passed to a function in correct positional order.
सही स्थिति क्रम में किसी फंक्शन को दिए गए आर्गुमेन्ट हैं।

Questions No: 12/50

What will be the output of the following?

def iq(a,b):
    if(a==0):
       return b
    else:
       return iq(a-1,a+b)
print(iq(3,6))

Questions No: 13/50

____ keyword used for function in python
पायथन में फ़ंक्शन के लिए कौन सा कीवर्ड उपयोग किया जाता है

Questions No: 14/50

How many arguments a Python program can accept from the command line?
पायथन प्रोग्राम कमांड लाइन से कितने तर्क स्वीकार कर सकता है?

Questions No: 15/50

You can also create your own functions, these functions are called?
आप अपने खुद के फंक्शन भी बना सकते हैं, इन फंक्शन्स को क्या कहते हैं?

Questions No: 16/50

If return statement is not used inside the function, the function will return:
यदि फंक्शन के अंदर रिटर्न स्टेटमेंट का उपयोग नहीं किया जाता है, तो फंक्शन रिटर्न करेगा:

Questions No: 17/50

How do you define a function in Python?
पायथन में एक फ़ंक्शन कैसे घोषित किया जाता है?

Questions No: 18/50

Structured program can be broken into to assign to more than one developer
एक से अधिक डेवलपर को असाइन करने के लिए संरचित प्रोग्राम को खंडित किया जा सकता है

Questions No: 19/50

The sequence logic will not be used while
____के समय सीक्वेंस लॉजिक का उपयोग नहीं किया जाएगा|

Questions No: 20/50

Which of these is not true about recursion?
इनमें से कौन सा रिकर्शन के बारे में सच नहीं है?

Questions No: 21/50

What will be the output of the following Python code?

def foo(x):
    x = ['def', 'abc']
    return id(x)
q = ['abc', 'def']
print(id(q) == foo(q))

Questions No: 22/50

What is a variable defined outside a function referred to as ?
किसी फ़ंक्शन के बाहर परिभाषित वेरिएबल को क्या कहते है?

Questions No: 23/50

What is the output of the following code?

def s(n1):
    print(n1)
    n1=n1+2
n2=4
s(n2)
print(n2)

Questions No: 24/50

what is Lambda function in python
पायथन में लैम्ब्डा फंक्शन क्या है ?

Questions No: 25/50

What is the value of the following Python code?

>>>print(36 / 4)

Questions No: 26/50

What will be the output of the following code snippet?

numbers = (4, 7, 19, 2, 89, 45, 72, 22)
sorted_numbers = sorted(numbers)
odd_numbers = [x for x in sorted_numbers if x% 2!=0]
print(odd_numbers)

Questions No: 27/50

Which part of the memory does the system store the parameter and local variables of a function call ?
मेमोरी का कौन सा भाग सिस्टम फ़ंक्शन कॉल के पैरामीटर और स्थानीय चर को संग्रहीत करता है?

Questions No: 28/50

What will be the output of the following Python code?

def foo(k):      
k[0] = 1  
q = [0]  
foo(q)  
print(q)

Questions No: 29/50

The function pow(x,y,z) is evaluated as:
फ़ंक्शन pow(x, y, z) का मूल्यांकन इस प्रकार है:

Questions No: 30/50

What is the output of the following?

x=123
for i in x:
    print(i)

Questions No: 31/50

Which of the following functions is a built-in function in python?
निम्नलिखित में से कौन सा फ़ंक्शन पायथन में एक अंतर्निहित फ़ंक्शन है?

Questions No: 32/50

The variables in a function definition are called as
फ़ंक्शन परिभाषा में वेरिएबल्स को कहा जाता है

Questions No: 33/50

What will be the output of the following Python code?

def foo():
    return total + 1
total = 0
print(foo())

Questions No: 34/50

How many numbers will be printed by the following code?

def fun(a,b):
    for x in range(a,b+1):
        if x%3==0:
            print(x,end=" ")
fun(100,120)

Questions No: 35/50

What will be the output of the following Python function?

len(["hello",2, 4, 6])

Questions No: 36/50

What happens if the base condition isn’t defined in recursive programs?
यदि रिकर्सिव फ़ंक्शन में बेस की कंडीशन को डिफाइन नहीं किया जाता है तो क्या होता है?

Questions No: 37/50

What will be the output of the following Python code?

def foo():
    total += 1
    return total
total = 0
print(foo())

Questions No: 38/50

What will be the output of the following Python code?

def foo(fname, val):
    print(fname(val))
foo(max, [1, 2, 3])
foo(min, [1, 2, 3])

Questions No: 39/50

Which of the following functions converts date to corresponding time in Python?
निम्नलिखित में से कौन सा फ़ंक्शन पायथन में दिनांक को संगत समय में परिवर्तित करता है?

Questions No: 40/50

Which of the following functions is a built-in function in pythonn
निम्न में से कौन सा फंक्शन पायथन में बिल्ट-इन फंक्शन है

Questions No: 41/50

Which is the most appropriate definition for recursion?
पुनरावृत्ति के लिए सबसे उपयुक्त परिभाषा कौन सी है?

Questions No: 42/50

Which of the following statements is false about recursion?
निम्नलिखित में से कौन सा स्टेट्मेंट रिकर्शन के बारे में गलत है?

Questions No: 43/50

What is the return type of following function ?

def func1():
       return 'mnp',22
print(type(func1()))

Questions No: 44/50

What will be the output of the following Python code?

from math import factorial
print(math.factorial(5))

Questions No: 45/50

To which of the following the "in" operator can be used to check if an item is in it?
निम्नलिखित में से किसके लिए "in" ऑपरेटर का उपयोग यह जांचने के लिए किया जा सकता है कि कोई आइटम उसमें है या नहीं?

Questions No: 46/50

Which keyword is used for function in Python language?
पायथन भाषा में फंक्शन के लिए कौन सा कीवर्ड प्रयोग किया जाता है?

Questions No: 47/50

Function defined to achieve some task as per the programmers requirement is called a :
प्रोग्रामर की आवश्यकता के अनुसार किसी कार्य को प्राप्त करने के लिए परिभाषित फंक्शन कहलाता है

Questions No: 48/50

Where is function defined?
फंक्शन को कहां डिफाइन किया जाता है?

Questions No: 49/50

The code block within every function starts with a ____ ?
प्रत्येक फंक्शन के भीतर एक कोड ब्लॉक ... से शुरू होता है?

Questions No: 50/50

What is the output of the following code ?

def fun(a, b=6):
    a=a+b
    print(a)
fun(5, 4)