Which of the following can be used as valid variable identifier(s) in Python?
-
total
-
7Salute
-
Que$tion
-
global
A.
total
Sponsor Area
Which of the following can be used as valid variable identifier(s) in Python?
total
7Salute
Que$tion
global
A.
total
Sponsor Area
Name the Python Library modules which need to be imported to invoke the following functions:
(i) ceil()
(ii) randint()
(i) Ceil() function requires math module.
(ii) randint() function requires randon module.
Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.
TEXT=''GREAT
DAY''
for T in range[0,7]:
print TEXT(T)
print T+TEXT
TEXT = 'GREAT'
DAY = ''
for T in range (0,7):
print TEXT [T]
print T, TEXT
The range(0,7) will give a runtime error as the index is out of range. It should be a range(0,6).
Find and write the output of the following Python code:
STR = ['90','10','30','40']
COUNT = 3
SUM = 0
for I in [1,2,5,4]:
S = STR[COUNT]
SUM = float (S)+I
print SUM
COUNT-=1
The Output of the given Python code is,
['41', '32', '15', '94']
Sponsor Area
Mock Test Series