Get Membership To Play All Videos In This Website.
Sign-in
Sign-up
Regular
Python
Membership
DataEngineering
Basics
Video Courses
Telugu Language
English Language
Online Tests
Online Test
Interview Questions
Online Store
Python Blog
Online Test
1). What is the output of print(type(42))??
A) <class 'int'>
B) <class 'str'>
C) <class 'float'>
D) <class 'bool'>
2). What is the correct syntax to create a function in Python??
A) function myFunc():
B) def myFunc():
C) create myFunc():
D) func myFunc():
3). Which of the following is used to insert comments in Python??
A) //
B) /* */
C) #
D) --
4). What is the output of print(2**3)??
A) 5
B) 6
C) 8
D) 9
5). How do you create a list in Python??
A) myList = {1, 2, 3}
B) myList = [1, 2, 3]
C) myList = (1, 2, 3)
D) myList = <1, 2, 3>
6). What is the output of print("Hello"[0])??
A) H
B) e
C) o
D) l
7). Which of the following methods can be used to add an element to a list??
A) append()
B) insert()
C) extend()
D) All of the above
8). How do you check if a is equal to b in Python??
A) a == b
B) a = b
C) a equals b
D) a is b
9). What is the output of print(7//2)??
A) 3
B) 3.5
C) 4
D) 2
10). Which keyword is used to define a class in Python??
A) function
B) class
C) method
D) define
11). What will be the output of len([1, 2, 3, 4])??
A) 4
B) 3
C) 5
D) 2
12). Which of the following is not a valid variable name in Python??
A) my_var
B) _var
C) 2var
D) var2
13). What is the output of print(2*3 == 6)??
A) TRUE
B) FALSE
C) Error
D) None
14). Which function is used to convert a string into an integer??
A) str()
B) int()
C) float()
D) chr()
15). How do you create an empty set in Python??
A) set = {}
B) set = ()
C) set = []
D) set = set()
16). What will be the output of print(4 % 2)??
A) 0
B) 2
C) 4
D) 1
17). Which of the following is a mutable data type in Python??
A) Tuple
B) String
C) List
D) Int
18). How do you declare a global variable inside a function??
A) global var_name
B) var_name
C) declare var_name
D) None of the above
19). What is the correct syntax to import the math module??
A) import math
B) math import
C) include math
D) import mathematics
20). Which operator is used to raise a number to a power??
A) ^
B) **
C) *
D) ^^
21). How do you get the number of elements in a list??
A) count(list)
B) list.len()
C) len(list)
D) size(list)
22). What is the output of print(10 > 9)??
A) TRUE
B) FALSE
C) None
D) Error
23). Which of the following is not a keyword in Python??
A) pass
B) continue
C) break
D) loop
24). How do you start a while loop in Python??
A) while i = 1 to 10:
B) while (i < 10)
C) while i < 10:
D) while (i < 10):
25). What will be the output of print("Python"[::-1])??
A) Python
B) nohtyP
C) Pytho
D) None
26). How do you handle exceptions in Python??
A) try...except
B) catch...except
C) try...catch
D) throw...except
27). What is the output of print(3 == 3.0)??
A) TRUE
B) FALSE
C) Error
D) None
28). Which of the following is a correct way to create a dictionary??
A) dict = {1, 2, 3}
B) dict = {1: "one", 2: "two"}
C) dict = ["one", "two", "three"]
D) dict = (1, "one", 2, "two")
29). Which of the following is a correct syntax to check if an element exists in a list??
A) if element in list:
B) if element exists list:
C) if element include list:
D) if element not in list:
30). What will be the output of print(2 + 3 * 4)??
A) 20
B) 14
C) 10
D) 5
Submit
Test Results