Lecture 2-3

 0    15 speciālā zīme    kapi2304
lejupielādēt mp3 Drukāt spēlēt pārbaudiet sevi
 
jautājums język polski atbilde język polski
Which of the following is the correct way to define an initializer method?
sākt mācīties
def __init__(self, title, author):
Given a function that does not return any value, What value is thrown by default when executed in the shell. Python shell throws a NoneType object back.
sākt mācīties
None
Which of the following statement is correct
sākt mācīties
List is mutable & Tuple is immutable
Suppose list1 is [1, 3, 2], What is list1 * 2 ?
sākt mācīties
[1, 3, 2, 1, 3, 2]
What is the output of: list1 = [1, 2, 3, 4] list2 = [5, 6, 7, 8] print(len(list1 + list2))
sākt mācīties
8
In which of the following we can use "in" operator to check the elements
sākt mācīties
dictionary, list, tuple
What is the output? print([i. lower() for i in "HELLO"])
sākt mācīties
[‘h’, ‘e’, ‘l’, ‘l’, ‘o’].
Predict the output List = [True, 50, 10] List. insert(2, 5) print(List, "Sum is: ", sum(List))
sākt mācīties
[True, 50, 5, 10] Sum is: 66
What is the output? print("Hello {0[0]} and {0[1]}". format(('foo', 'bin')))
sākt mācīties
Hello foo and bin
What is the output? values = [[3, 4, 5, 1], [33, 6, 1, 2]] v = values[0][0] for lst in values: for element in lst: if v > element: v = element print(v)
sākt mācīties
1
Which of the following data type use Key: pair
sākt mācīties
dictionary
The required steps for Divide-and-conquer algorithms are:
sākt mācīties
Divide, Conquer and Combine
Division Pattern of Problems in Divide and Conquer approach Select one:
sākt mācīties
Recursive
The best way to search for an element in a list is to start from the:
sākt mācīties
middle element
How many passes does an insertion sort algorithm consist of?
sākt mācīties
N-1

Lai ievietotu komentāru, jums jāpiesakās.