Home
Services
Internship
Internship Registration
Offer Letter
Task Submission
Certificate
Intern Profile
Tasks
Profile
Code Editor
Contact Us
Certification
Blog
Python Developer Certification Quiz
1. What will be the output of the following code?
x = 5
y = 3
print(x + y)
8
53
2
Error
2. Which of the following is used to create a list in Python?
[]
{}
<>
()
3. What is the correct way to define a function in Python?
def myFunc():
func myFunc():
function myFunc():
create myFunc():
4. Which Python keyword is used to define a class?
define
function
struct
class
5. How can you create a comment in Python?
<!-- This is a comment -->
# This is a comment
// This is a comment
/* This is a comment */
6. What is the correct way to create a dictionary in Python?
{key: value}
<key, value>
[key, value]
(key, value)
7. Which of the following data types is immutable in Python?
set
tuple
dictionary
list
8. What does the len() function do in Python?
It checks if a string is empty
It returns the sum of all elements
It converts an object to a string
It returns the length of an object
9. Which of the following will raise an error in Python?
5 / 2
5 // 2
5 * 2
5 / 0
10. Which Python operator is used for exponentiation?
*
**
%
^
11. What will be the output of the following code?
x = [1, 2, 3, 4]
x.append(5)
print(x)
[1, 2, 3]
[5, 1, 2, 3, 4]
[1, 2, 3, 4, 5]
Error
12. Which function is used to take input from the user in Python?
input()
read()
scan()
get_input()
13. What is the result of True + True in Python?
2
1
True
Error
14. Which keyword is used to exit a loop in Python?
break
return
stop
exit
What will be the output of the following code?
for i in range(3): print(i)
0 1 2
0 1 2 3
1 2
1 2 3
16. What is the purpose of the
continue
statement in a loop?
It restarts the loop
It skips the current iteration and continues with the next one
It pauses the loop
It exits the loop
17. Which function is used to find the largest number in a list?
top()
largest()
max()
big()
18. What will be the output of
print(bool(""))
in Python?
False
None
Error
True
19. What will be the output of the following code?
x = "Python" print(x[0])
P
y
t
h
Submit Quiz
Quiz Result