The function which cause side effects to the arguments passed are called __________.
a.
Dynamic function
b.
Impure function
Correct Answer
c.
Pure function
d.
Partial function
Step-by-Step AI Explanation
Verified Method
The correct answer is (b) Impure function. An impure function may produce side effects or depend on external state, so the result is not determined only by its input arguments. A pure function, on the other hand, does not cause side effects and always gives the same output for the same inputs.
Q2mcq1 mark
The datatype whose representation is known are called __________.
a.
Concrete datatype
Correct Answer
b.
Built in datatype
c.
Abstract datatype
d.
Derived datatype
Step-by-Step AI Explanation
Verified Method
The correct answer is (a) Concrete datatype. Concrete datatypes are datatypes whose representation is known. In contrast, abstract datatypes hide their internal representation and expose only operations.
Q3mcq1 mark
Which members are accessible from outside the class ?
a.
Secured members
b.
Public members
Correct Answer
c.
Private members
d.
Protected members
Step-by-Step AI Explanation
Verified Method
The correct answer is (b) Public members. Public members of a class are accessible from outside the class. Private members are accessible only within the class, and protected members are accessible only in the class and its derived classes.
Q4mcq1 mark
Two main measures for the efficiency of an algorithm are __________.
a.
Time and Space
Correct Answer
b.
Processor and Memory
c.
Complexity and Time
d.
Data and Space
Step-by-Step AI Explanation
Verified Method
The correct answer is (a) Time and Space. The efficiency of an algorithm is mainly measured by its time complexity and space complexity. Time measures how long the algorithm takes, and space measures the memory used.
Q5mcq1 mark
Which key is used to execute Python Script ?
a.
F5
Correct Answer
b.
F1
c.
F10
d.
F2
Step-by-Step AI Explanation
Verified Method
The correct answer is (a) F5. In Python IDEs such as IDLE, the F5 key is used to execute the Python script.
Q6mcq1 mark
Which of the following is the output of the given Python code if the value of $a$ is 52 ?
x='even' if $a\%2==0$ else 'odd'
print(x)
a.
error
b.
even
Correct Answer
c.
no output
d.
odd
Step-by-Step AI Explanation
Verified Method
The correct answer is (b) even. Since $a = 52$, the condition $a\%2==0$ is true because 52 is divisible by 2. So the expression assigns 'even' to x, and print(x) displays even.
Q7mcq1 mark
A function which calls itself is called as :
a.
Lambda
b.
Built in
c.
Return
d.
Recursion
Correct Answer
Step-by-Step AI Explanation
Verified Method
The correct answer is (d) Recursion. A function that calls itself is called a recursive function, and the process is known as recursion.
Q8mcq1 mark
Which of the following operator is used for concatenation ?
a.
*
b.
1
c.
=
d.
&
Correct Answer
Step-by-Step AI Explanation
Verified Method
The correct answer is (d) &. In many programming contexts, the ampersand symbol is used for concatenation in this question's options. The other choices are not concatenation operators: * means multiplication, 1 is a number, and = is assignment.
Q9mcq1 mark
If mylist=[10, 20, 30, 40] then mylist.append(35) will result :
a.
[10, 35, 20, 30, 40]
b.
[10, 20, 30, 40, 35]
Correct Answer
c.
[35, 10, 20, 30, 40]
d.
[10, 20, 30, 35, 40]
Step-by-Step AI Explanation
Verified Method
The correct answer is (b) [10, 20, 30, 40, 35]. In Python, append(35) adds the new element to the end of the list. It does not insert it in the middle or remove any existing element.
Q10mcq1 mark
Which of the following is the private class variable ?
a.
$$num
b.
__num
Correct Answer
c.
++num
d.
##num
Step-by-Step AI Explanation
Verified Method
The correct answer is (b) __num. In Python, a variable name beginning with double underscores is treated as a private class variable by convention. The other options are not valid Python private-variable indicators.
🎉 10 Free Sample Solutions Completed
Unlock All 37 Questions & Solutions
Sign up free in seconds to unlock step-by-step AI answers for the remaining 27 questions.
Evaluate the following function and write the output.
import math
x=26.72
y=64
print(math.floor(x))
print(math.ceil(x))
print(math.sqrt(y))
print(round(x,1))
Correct Answer & Step-by-Step Solution Locked
Sign in free to reveal the correct answer and AI explanation for this question.
(A)Identify in the following program.
let rec gcd a b :=
if b < > 0 then gcd b (a mod b)
else
return a
(i)Name of the function.
(ii)Identify the statement which tells it is a recursive function.
(iii)Name of the argument variables.
(iv)Statement which invoke the function recursively.
(v)Statement which terminates the recursion.
OR
(b)Explain the different ways to delete elements from the list in Python with example.
Correct Answer & Step-by-Step Solution Locked
Sign in free to reveal the correct answer and AI explanation for this question.
(A)Write the output of the following Python statements.
strl=''Welcome to Python Programming ''
print(strl[11:16])
print(strl[11:])
print(strl[:7])
print(strl[::3])
print(strl[::-5])
OR
(b)Explai
Correct Answer & Step-by-Step Solution Locked
Sign in free to reveal the correct answer and AI explanation for this question.
Consider the following student table. Write SQL commands for the questions (i) to (v).
Rollno Name Gender Average
101 ANU Female 98
102 BALAN Male 95
103 RAVI Male 82
104 DEVI Female 89
105 MANI Male 75
(i)To display all details of all students in descending order of name.
(ii)To add details of a new student.
(iii)To display all student details whose Average is between 70 and 90.
(iv)To remove the student detail whose Rollno=103.
(v)To display the details of female students.
OR
Write the Matplotlib functions for the following statements.
(i)To label the x axis.
(ii)To label the y axis.
(iii)To assign the plot’s title.
(iv)To display the plot.
(v)To invoke the default legend.
Correct Answer & Step-by-Step Solution Locked
Sign in free to reveal the correct answer and AI explanation for this question.