NEW
Font size
WorksheetsPython Quiz
Total questions: 15
Worksheet time: 8mins
Who developed the Python programming language?
Rasmus Lerdorf
Wick van Rossum
Guido van Rossum
Niene Stom
Python was first developed as a successor for which programming language?
Perl
C
Cobra
ABC
In which language is Python written ?
C
C++
Java
ABC
The Python Enhancement Proposal (PEP) that enumerates stylistic guidelines for Python code is:
PEP 257
PEP 8000
PEP 20
PEP 8
Which method can be used to remove any whitespace from both the beginning and the end of a string?
trim()
strip()
len()
replace()
Dictionary keys must be immutable
True
False
Which method can be used to replace parts of a string?
replace()
repl()
replaceString()
switch()
What is a correct syntax to return the first character in a string?
x = "Hello"[0]
x = sub("Hello", 0, 1)
x = "Hello".sub(0, 1)
All of the above
What will be the output:
53
abc
ab
Error
What is the correct syntax to output the type of a variable or object in Python?
print(typeof(x))
print(typeOf(x))
print(type(x))
print(typeof x)
What will be the output:
1#2
1#2#2
1
Error
Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?
Error
None
2
25
What will be the output:
global
local
none
Cannot be predicted
What will be the output:
('string', 197, 66, 55, 44)
(44, 55, 66, 197, 'string')
None
(44, 55, 66, 197)
Suppose t = (1, 2, 4, 3), which of the following is incorrect?
print(t[3])
print(max(t))
print(len(t))
t[3]=45
