Questions | Python | DBMS | Coding | Duration | Correct | Incorrect |
20 | 13-15 | 5-7 | – | 30 min | +4 | -0 |
0 of 20 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 20 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Average score |
|
Your score |
|
Thanks for taking this Mock Test.
Pos. | Name | Entered on | Points | Result |
---|---|---|---|---|
Table is loading | ||||
No data available | ||||
Syntax of constructor in Python?
def display_cat_details(color, name1, name2=None, name3=None): #line 1
pass
display_cat_details("Brown","Fluffy","Snow")
Which of the following function signatures when replaced in line1 will continue to execute successfully
def vending_machine(insert_money,item_id):
if item_id == 101 and insert_money:
#line1
#line2
insert_money=True
item_id = 101
print(vending_machine(insert_money,item_id))
Which of the following can help us to find the version of python that we are
currently working on?
def bubble_sort(input_list): num = len(input_list) for index1 in range(num): for index2 in range(0, num-index1-1): if input_list[index2] > input_list[index2+1]: input_list[index2], input_list[index2+1] = input_list[index2+1], input_list[index2] input_list = [4,10,2,7,1,8] bubble_sort(input_list)
What will be the content of input_list after third pass ?
To execute a python program using command prompt, which command is used ?
def binary_search(num_list, element):
low=0
high=len(num_list)-1
mid=(low+high)//2
while(num_list[mid]!=element and low<high):
if(element>num_list[mid]):
low=mid+1
else:
high=mid-1
mid=(low+high)//2
if(element == num_list[mid]):
print("Element is in the list at index", mid)
else:
print("Element is not in the list")
Above code is for Binary Search Algorithm for the list of elements sorted in ascending order, what modifications are required if it has to be used for the list which is in descending order.
Consider the following : What must be written in line1, line2, line3 to print [‘p’,’o’,’c’]as o/p :
def function(string,list1):
#line1
while(num!=len(string)):
if len(string)%2==0 or (string[num] in ('a','e','i','o','u')):
list1.append(string[num])
#line2
#line3
break
return list1
print(function("Epoch",[]))
Hexadecimal values in Python are represented as :
Consider the following code below code using ‘Logic Coverage’ technique :
if item_type =="Fashion":
if amount>500 and amount<=1000:
amount=amount-0.1*amount
elif item_type=="Electronics":
if amount>10000 and amount<15000:
amount=amount-0.15*amount
else:
if amount>2000:
amount= amount- 0.07*amount
print("final amount", amount)
def sample(v1,v2,v3=10,v4=3,*v5):
v4+=2
v2= v1*v4
for v in v5:
v = v*v
print(v1,v2,v3,v4,v5)
sample(0,0,1,2,3,4,5)
What will the value of v5 ?
input_linked_list: 1->4->9->16
What will be the value of the elements in the input_linked_list after the
function fun() is invoked by passing the head of the input_linked_list as an
argument?
def fun(head):
next_node = head.get_next()
while(head!=None and next_node != None):
head.set_data(head.get_data()+next_node.get_data())
head = head.get_next()
next_node = head.get_next()
if(next_node != None):
head.set_data(head.get_data()+next_node.get_data())
Note: Order of displaying the elements is from head to tail.
class Glove:
def __init__(self,color):
self.__color = color
def get_color(self):
return self.__color
def set_color(self,color):
self.__color= color
class Minion:
def __init__(self,glove):
self.__glove=glove
self.__color="Yellow"
def get_glove(self):
return self.__glove
black_glove = Glove("Black")
red_glove = Glove("Red")
bob = Minion(black_glove)
black_glove.set_color(red_glove.get_color())
print(#line)
What should be placed in the place of #line to get the color of bob Minion's glove ?
How many reference variable(s) refer to the object created in line1 at the end of line2 ?
class Team:
counter=0
def __init__(self):
self.no_of_pllyers=11
self.coach=None
cricket_team=Team() #line1
football_team=Team()
hockey_team=football_team
football_team=cricket_team
football_team=Team() #line2
What is delattr(obj,name) used for?
Choose the correct option :
Which of the following normal form deals with the repeating group anomaly ?
Choose the correct answer :
If we do want to eliminate duplicates, we use the keyword ______in the aggregate expression.
Choose the correct option :
Consider the following relational schemes for a library database:
Book (Title, Author, Catalog_no, Publisher, Year, Price)
Collection (Title, Author, Catalog_no)
Functional dependencies:
I. Title Author –> Catalog_no
II. Catalog_no –> Title Author Publisher Year
III. Publisher Title Year –> Price
Assume {Author, Title} is the key for both schemes. Which of the following statements is true?
Choose the correct opinion :
How to select all data from student table starting the name from letter ‘s’ ?
Choose the correct option :
Which of the following condition(s) is not a part of updating a view :