Questions

1 Marks Each

🎯

Test yourself on this topic

13 questions · timed · auto-graded

Question 11 Mark
Define Scope.
Answer
Scope of a variable refers to the part of the module where it can be used. A variable can have local scope or global scope.
View full question & answer
Question 21 Mark
Write the function header(declaration) which consist of two parameter one is x and other one is y with its default value "hi".
View full question & answer
Question 41 Mark
Write the purpose of def keyword.
Answer
def is a keyword which is used to define a function. Any function definition in Python has to be marked with the keyword def.
View full question & answer
Question 61 Mark
Write the use of the following keywords: return
Answer
Keyword return is used to return a value from a function.
For example, return 10
View full question & answer
Question 71 Mark
Write the use of the following keywords: def
Answer
Keyword def is used to define functions in Python.
For example def Hello():
View full question & answer
Question 91 Mark
Define the following terms: Parameters
Answer
Parameters: Parameters (Also called formal parameters) are the variables defined in function header. Parameters represent the values/references
to be received from function call.
For example, def display (a, b):
View full question & answer
Question 101 Mark
Define the following terms: Global variable
Answer
Global variable: A global variable is a variable which is defined outside any function, or defined inside a function with global keyword. A global
View full question & answer
Question 111 Mark
Define the following terms: Local variable
Answer
Local variable: A local variable is a variable which is defined inside a function, without keyword 'global'. A local variable can be used only in the function in which it is declared.
View full question & answer
Question 121 Mark
Define the following terms: Scope of a variable,
Answer
Scope of a variable: Scope of a variable refers to the part of the module, where it can be used.
View full question & answer
Question 131 Mark
Define the following terms: Function,
Answer
Function: A Function is a group of statements or subprogram/ subroutines with a well-defined task to perform.
View full question & answer
1 Marks Each - Computer Science STD 12 Humanities Questions - Vidyadip