Python functions (Built-in and User defind functions)

Quiz
•
Computers
•
11th Grade
•
Hard
alaa jaber
Used 4+ times
FREE Resource
26 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used for defining afunction in python?
define
fun
def
function
Answer explanation
In Python, the keyword 'def' is used to define a function. The other options, 'define', 'fun', and 'function', are not valid keywords for this purpose.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The function pow(x,y) is evaluated as:
x*y
x**y
x%y
None is true
Answer explanation
The function pow(x,y) computes x raised to the power of y, which is represented as x**y in Python. Therefore, the correct answer is x**y.
3.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
If return statement is not used inside the function, the function will return:
None
0
Null
Arbitary value
Answer explanation
In Python, if a function does not have a return statement, it implicitly returns None. Therefore, the correct answer is None.
4.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What is a variable defined outside a function referred to as?
local variable
global variable
static variable
automatic variable
Answer explanation
A variable defined outside a function is accessible throughout the program, making it a global variable. In contrast, local variables are defined within a function and are only accessible there.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When defining a function, the definition must occur before it is called.
True
False
Answer explanation
True. In programming, a function must be defined before it can be called. This ensures that the interpreter knows the function's behavior and can execute it correctly when invoked.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The values being passed through a function-call statement are called,
arguments
alternatives
actual argument
actual parameter
Answer explanation
The values passed in a function-call statement are referred to as 'arguments'. This term encompasses all values provided to the function, making 'arguments' the correct choice over alternatives like 'actual argument' or 'actual parameter'.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The values received in the function definition header are called ,
parameter
alternatives
formal parameter
formal argument
Answer explanation
In function definitions, the values specified in the header are referred to as 'parameters'. They act as placeholders for the actual values (arguments) that will be passed when the function is called.
Create a free account and access millions of resources
Similar Resources on Wayground
25 questions
Quiz INFORMATIKA

Quiz
•
11th Grade
25 questions
PYTHON QUIZ 1

Quiz
•
11th - 12th Grade
21 questions
Basic Python Console Operations

Quiz
•
10th Grade - University
26 questions
Python set 1

Quiz
•
9th - 12th Grade
25 questions
10 điểm ICT 15 phút (14/11/2023)

Quiz
•
11th Grade
25 questions
Data Types- Python

Quiz
•
7th - 11th Grade
21 questions
Quiz 1

Quiz
•
9th - 12th Grade
23 questions
GCSE CS - 2.5 Translators and Facilities of Languages

Quiz
•
9th - 11th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
40 questions
LSHS Student Handbook Review: Pages 7-9

Quiz
•
11th Grade
20 questions
Scalars, Vectors & Graphs

Quiz
•
11th Grade
62 questions
Spanish Speaking Countries, Capitals, and Locations

Quiz
•
9th - 12th Grade
10 questions
Solving Equations Opener

Quiz
•
11th Grade
20 questions
First Day of School

Quiz
•
6th - 12th Grade
21 questions
Arithmetic Sequences

Quiz
•
9th - 12th Grade