FUNCTIONS

An illustration of a computer screen displaying Python code with fun characters interacting with it, highlighting fun<wbr>ctions and programming concepts in a vibrant, engaging style.

Functions Mastery Quiz

Test your knowledge of functions in Python with this engaging quiz! Whether you're a student, teacher, or just someone looking to sharpen your programming skills, this quiz is designed for you.

Challenge yourself with questions that cover:

  • Function definitions and arguments
  • Function calls and outputs
  • Understanding return values
11 Questions3 MinutesCreated by CodingNinja42
NAME
The list of arguments present in function header are called
Actual arguments
Formal arguments
Local arguments
Positional arguments
The arguments present in the function call are called
Formal arguments
Actual arguments
Header list
Main arguments
def calculate(x,y,z=10):
         res=x*y-z
         print(res)
 
select the correct function calls?
Calculate(8,8)
Calculate(6,y=9,20)
Calculate(4,5,6)
Calculate(x=9,3,y=12)
def calculate(x,y,z=10):
         res=x*y-z
         print(res)
 
Find the output of the function call
calculate(3,4,5)
calculate(x=20,y=5)
7,90
90,7
9,70
70,9

Give the correct function call statement

def vote(age):

    if age>18:

        print("Eligible to vote")

    else:

        print("Not eligible to Vote")

Ans=vote(23)
Vote(23)
Print(vote(23))
A function can return zero,one or more values .True/False?
True
False
what is the output?
def change(x)
      x=x+10
      print(x)
y=20
change(y)
print(y)
20,20
30,30
30,20
20,30

def prime(n):

    if (n>1):

        for I in range(2,n):

            if n%i==0:

                return(False)

        else:

             return(True)

#main

 

print(prime(34))

 
PRIME
True
False
NOT PRIME

def prime(n):

    if (n>1):

        for I in range(2,n):

            if n%i==0:

                return(False)

        else:

             return(True)

#main

s=prime(6)

if s:

    print("It is a prime number")

else:

   print("Not a prime number")
 
Find the output
It is a prime number
Not a prime number
True
False

def prime(n):

    if (n>1):

        for I in range(2,n):

            if n%i==0:

                return(False)

        else:

             return(True)

#main

s=prime(19)

print(s)
 
Find the output
True
False
Prime
Not prime
{"name":"FUNCTIONS", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Test your knowledge of functions in Python with this engaging quiz! Whether you're a student, teacher, or just someone looking to sharpen your programming skills, this quiz is designed for you.Challenge yourself with questions that cover:Function definitions and argumentsFunction calls and outputsUnderstanding return values","img":"https://cdn.poll-maker.com/104-5106870/img-ulj3ujkwlbbnbtdgiiwlgvyp.jpg"}
Powered by: Quiz Maker