Font size
Worksheets15 days of code quiz 2
Total questions: 22
Worksheet time: 1hrs 4mins
What type of exception will be raised for the code given below?
num_1 = 546
num_2 = '786'
print (num_1 + num_2)
syntax error
type error
index
system
3. What will be output of the code given below?
x = 10
def func(num):
x = 5 for i in num: x *= I
return x
print(func((-2, -1, 1, 2, 3)))
50
56
55
60
Identify the correct statements.
I. Scatter plot is used to convey the relationship between two numerical variables
II. Histogram is used to depict the shape and spread of a continuous variable
III. Bar plot is used to depict the visual representation of statistical five-number summary of a variable
I and III only
I, II, III
I and II only
II and III only
What is the statistical measure related to the box plot?
Mean
median
standard variation
variance
In python, in order to check the null values, which function(s) is / are used?
isnull()
isna()
isnan()
None
NumPy Arrays can be created from:
Lists
Arrays
Nested Python Lists
Random numbers
Pandas series
Choose the correct statement (s):
NumPy arrays better than lists
Lists are better than NumPy arrays
arange() function returns evenly spaced values within a given interval.
arange() function returns evenly spaced numbers over a specified interval.
An array x contains 0 and the following operation: 1/x is performed. What will be the output?
ZeroDivisionError
ValueError
It will give a warning, but not an error
NotImplementedError
Match the following column A (Error Name) with Column B (Description)
I RuntimeError -------A Raised when interpreter detects internal error
II SystemError -- B Raised when a function gets an argument of correct type but improper value
III ValueError------- C Raised when a variable is not found in local or global scope
IV NameError------- D Raised when an error does not fall under any other category
I- A, II- D, III- C, IV- B
I- D, II- A, III- B, IV- C
I- C, II- D, III- A, IV- B
I- A, II- B, III- C, IV- D
What is the output of the following code?
def funcl():
n = 10
print('n in funcl = ' ,n)
def func2():
n = 20
print('n in func2 before call to funcl =' , n)
funcl()
print('n in func2 after call to funcl = ' ,n)
func2()
n in func2 before call to funcl = 20
n in funcl = 10
n in func2 before call to funcl = 20
n in funcl = 10
n in func2 after call to funcl = 20
n in funcl = 10
n in func2 after call to funcl = 20
None
Choose the correct statement(s) about Object- Oriented Programming?
Top-down approach
Does not support code reusability
Provides data hiding
Main features: Polymorphism, Encapsulation, Inheritance
All of the above
Which of the following options are False w.r.t a class?
A class does not take memory space when created
Classes can be declared multiple times
Class is a physical entity
All of the above
_____ has two or more methods having the same name but different parameters or signature.
Polymorphism
Overriding
Overloading
Dynamic polymorphism
Match the following
I Abstract Class -------A Public by default.
II Interface ------ B Can be private, public, etc.
III Interface ------- C Can provide the implementation of an interface.
IV Abstract Class ------- D Variables declared are final by default
I-B, II- D, III- A, IV- C
I-A, II- B, III- C, IV- D
I-D, II- C, III- B, IV- A
I-C, II- D, III- A, IV- B
While opening a file in python,
‘w’ indicates______ and ‘a’ indicates______:
re-write, add
write to different file, append to existing file
re-write, append to different file
write to same file, append to existing file
Select the correct sequence operations:
max()
sort()
len()
index()
Slice
Which of the following are python bitwise operators?
&
^
*
||
~
Choose the correct output of the following Python code snippet?
k = [print(i) for i in my_string if i not in "aeiou"]
prints all the vowels in my_string
prints all the consonants in my_string
prints all characters of my_string that aren’t vowels
prints only on executing print(k)
What is the output of the code shown below?
t=23.00
[round((x-23)*4/5) for x in t]
[0]
0
[0.00]
Error
Registered E-mail address
How would you rate the Course?
1
2
3
4
5
