Page 298 - Computer Science Class 11 With Functions
P. 298
print('The tangent of angle ', angleDegree, ' degrees is ', math.tan(angleRadian ))
angleDegree = int(input('Enter angle in degrees '))
trigo(angleDegree)
Assessment
A. Multiple Choice questions
1. Consider the given Python code.
import random
devices = ['Monitor', 'Keyboard', 'Mouse', 'Speaker']
for i in range(random.randint(0, 2)):
print(devices[i], '*', end=' ')
Which of the following lines of output will never be produced on execution of the above code?
a. Monitor * Keyboard *
b. Monitor*
c. Monitor * keyboard * Mouse *
d. None of these
2. Consider the program given below:
import random
values = [10, 30, 50, 70, 90, 110, 130]
fromVal = random.randint(1, 3)
to = random.randint(2, 4)
for i in range(fromVal, to + 1):
print(values[i], end = '*')
Which of the following lines of output will never be produced on execution of the above code?
a. 50*70* b. 30*50*70* c. 30*50*70*90* d. 50*70*90*110*
3. Consider the following statements and select the output that will be produced on the execution of the following
code:
>>> dict1 = {1:'one', 2:'two', 3:'three', 4:'four'}
>>> len(dict1.keys())
a. 8 b. 15 c. 4 d. 19
4. Consider the program given below:
import random
picker = random.randint(0, 3)
color = ['BLUE', 'PINK', 'GREEN', 'RED']
for i in color:
for j in range(1, picker):
print(i, end='')
print()
Which of the following lines of output will be produced on execution of the above code?
a. BLUE
GREEN
PINK
RED
296 Touchpad Computer Science-XI

