Wednesday 21 August 2019

The Joy of Computing using Python: Assignment 3:


1 point
1. What will be the output of following program?
numbers = [1, 2, 3, 4]
numbers.append([5,6,7,8])
print(len(numbers))
 
 
 
 
1 point
2. What will be displayed by the following code?
list1 = [1, 3]
list2 = list1
list1[0] = 4
print(list2)
 
 
 
 
1 point
3. What does the function random.randrange(49,150) return in Python?
 
 
 
 
1 point
4. Which of the following options is the possible outcome of the function shown below?

random.randrange(1,100,10)
 
 
 
 
1 point
5. What can be the output of the following code snippet?
list = [55, 66, 77, 88, 99]
print(random.choice(list))
 
 
 
 

Ans: d
1 point
6. If the word in your mind is HIT, in how many ways can you pose the jumbled question?
 
 
 
 
1 point
7. How is trimmed mean calculated?
 
 
 
 
1 point
8. State True or False.
   Matplotlib in Python can only generate line graphs.
 
 
1 point
9. What is the output of the following matplotlib program?
from matplotlib import pyplot as plt
x = [1, 2, 3, 4, 5]
y = [1, 2, 3, 4, 5]
plt.plot(x,y)
plt.show()

 
 
 
 
Ans: a

4 comments: