Skip to content
J2J Institute
Search
K
Main Navigation
Home
Jobs
Code here
Courses
Java
Core
Advanced
Python
SQL
PowerBI
Testing
Manual
Automation
Interview Questions
Java
Python
SQL
Manual
Automation
Quiz
Java
Python
SQL
Appearance
Menu
Return to top
On this page
Beginner level python quiz
What is the correct way to declare a variable in Python?
var x = 10
x = 10
let x = 10
int x = 10
Which of the following is used for commenting in Python?
// comment
# comment
/* comment */
<!-- comment -->
How do you create a list in Python?
[]
()
{}
<>
Which data type is used to store decimal numbers in Python?
int
str
float
bool
How do you define a function in Python?
function myFunction()
def myFunction()
function: myFunction()
define myFunction()
Which of the following is used for a conditional statement in Python?
if
for
while
try
What is the output of the following code: print(2 + 3 * 4)?
14
20
5
7
What does the len() function do in Python?
Returns the type of the object
Returns the number of elements in an object
Converts an object to a list
Checks if the object is empty
What is the keyword used to define a class in Python?
class
def
object
new
Which of the following is used to import a module in Python?
import
include
use
require
Submit