1.find The Correct Identifiers Out
1.find The Correct Identifiers Out
Find the correct identifiers out of the following, which can be used for naming
Variable, Constants or Functions in a python program :
For, while, INT, NeW, del, 1stName, Add+Subtract, name1
5.In order to store values in terms of key and value we use what core data type.
a) list b) tuple c) class d) dictionary
6. Evaluvate the following:
a)8 * 3 + 2**3 // 9 – 4 b) not(20>6) or (19>7)and(20==20)
c) 7 // 5 + 8 * 2 / 4 – 3 d) not True and False or True
7. Consider the following code and find out the possible output(s) from the options
given below. Also write the least and highest value that can be generated.
import random as r
print(10 + r.randint(10,15) , end = ‘ ‘)
print(10 + r.randint(10,15) , end = ‘ ‘)
print(10 + r.randint(10,15) , end = ‘ ‘)
print(10 + r.randint(10,15))
i) 25 25 25 21 iii) 23 22 25 20
ii) 23 27 22 20 iv) 21 25 20 24
8.What possible outputs(s) are expected to be displayed on screen at the time of
execution of the program from the following code? Also specify the maximum values
that can be assigned to each of the variables first, second and third.
from random import randint
LST=[5,10,15,20,25,30,35,40,45,50,60,70]
first = randint(3,8)
second = randint(4,9)
third = randint(6,11)
print(LST[first],"#", LST[second],"#", LST[third],"#")
(i) 20#25#25# (ii) 30#40#70# (iii) 15#60#70# (iv) 35#40#60#