Professional Documents
Culture Documents
4. In python, the non-zero value is treated as.............. and zero values is treated as.......................
5. The function which is written by the programmer as per his/her requirements is known
as...................
6. The .........................of a variable is the area of the program where it may be referred.
8. Function that do not explicitly return a value return the special object ................
11. The ................... module lets you send and receive http request and their results .
14. ....................... means accessing or processing each element of any data structure.
Push(5),push(8),pop(),push(2),push(5),pop(),pop(),pop(),push(1),pop()
16. Pushing an element into a stack already having 10 elements and a stack of size 10,then the stack
becomes.....................
18. In ....................... the given argument types can be skipped from a function call.
29. Define stack?What basic operations can be performed on them?Enlist some applications of
stacks.
30. Explain data item and data type.
Q.2. The command to merge the dictionary Book with Library the command would be:
a. d=Book+Library
b. print(Book+Library)
c. Book.update(Library)
d. Library.update(Book)
Q.5. With reference to the above declared dictionaries, predict the output of the following code
fragments
35. Predict the output
a. b=[[9,6],[4,5],[7,7]] b. b=[[9,6],[4,5],[7,7]]
x=b[:2] x=b[:2]
x.append(10) x[1].append(10)
print(x) print(x)
36. Consider the following similar codes ,carefully go through these and predict the output
i. x='ball'
y='boy'
c=[x+y for x in 'ball' for y in 'boy']
print(c)
ii. text=['h','a','r','d','w','o','r','k']
print(text)
vowels="aeiou"
newtext=[x.upper() for x in text if x not in vowels]
print(newtext)
37. Define Binary search . Illustrate the process of binary search in array with an example. write
the program to implement the same.