Python Basics Quiz Practice Test
The test contains 50 questions and has a time imit of 30 minutes
The test contains 50 questions and has a time imit of 25 minutes
The test is not official, it's just a nice way to see how much you know, or don't know, about Python.
- 01
Who developed Python Programming Language?
- 02
Which type of Programming does Python support?
- 03
Is Python case sensitive when dealing with identifiers?
- 04
Which of the following is the correct extension of the Python file?
- 05
Is Python code compiled or interpreted?
- 06
All keywords in Python are in _________
- 07
What will be the value of the following Python expression?
4 + 3 % 5
- 08
Which of the following is used to define a block of code in Python language?
- 09
Which keyword is used for function in Python language?
- 10
Which of the following character is used to give single-line comments in Python?
- 11
What will be the output of the following Python code?
i = 1 while True: if i%3 == 0: break print(i) i += 1 - 12
Python supports the creation of anonymous functions at runtime, using a construct called __________
- 13
What is the order of precedence in python?
- 14
What will be the output for statement 'x<<2' if x=1?
- 15
Which of the following is true for variable names in Python?
- 16
Which of the following is the truncation division operator in Python?
- 17
What will be the output of the following Python code?
l=[1, 0, 2, 0, 'hello', '', []] list(filter(bool, l))
- 18
Which of the following functions is a built-in function in python?
- 19
Which of the following is the use of id() function in python?
- 20
Which of the following is not a core data type in Python programming?
- 21
What will be the output of the following Python expression if x=56.236?
x = 56.236 print("%.2f" % x) - 22
Which of these is the definition for packages in Python?
- 23
What will be the output of the following Python function?
len(["hello",2, 4, 6])
- 24
Which one of the following is not a keyword in Python language?
- 25
Which module in the python standard library parses options received from the command line?
- 26
Which of the following statements is used to create an empty set in Python?
- 27
To add a new element to a list we use which Python command?
- 28
Which one of the following is the use of function in python?
- 29
What will be the output of the following Python program?
i = 0 while i
- 30
What will be the output of the following Python code?
x = 'abcd' for i in range(len(x)): print(i) - 31
What are the two main types of functions in Python?
- 32
Which of the following is a Python tuple?
- 33
What will be the output of the following Python code snippet?
z=set('abc$de') 'a' in z - 34
What will be the output of the following Python expression?
round(4.576)
- 35
Which of the following is a feature of Python DocString?
Select all that apply
- 36
What will be the output of the following Python code?
print("Hello {0[0]} and {0[1]}".format(('foo', 'bin'))) - 37
What is output of print(math.pow(3, 2))?
- 38
The process of pickling in Python includes ____________
- 39
What will be the output of the following Python code?
- 40
What will be the output of the following Python statement?
"a"+"bc"
- 41
What will be the output of the following Python statement?
abcd"[2:]
- 42
The output of executing string.ascii_letters can also be achieved by:
- 43
What arithmetic operators cannot be used with strings?
- 44
What will be the output of the following Python code?
print(r"\nhello")
- 45
To concatenate two strings to a third what statements are applicable?
- 46
What will be the datatype of the var in the below code snippet?
var = 10 print(type(var)) var = "Hello" print(type(var))
- 47
What will be the output of the following code snippet?
count = 0 while (True): if count % 3 == 0: print(count, end=" ") if (count > 15): break count += 1 - 48
What will be the output of the following code snippet?
def solve(a, b): return b if a == 0 else solve(b % a, a) print(solve(20, 50))
- 49
What will be the output of the following code snippet?
weekdays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"] result = weekdays[-4:-1] print(result)
- 50
What will be the type of the variable sorted_numbers in the below code snippet?
numbers = (4, 7, 19, 2, 89, 45, 72, 22) sorted_numbers = sorted(numbers) print(type(sorted_numbers))