wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Basics

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

How to insert comments in Python ?

a)

# this is a comment

b)

// this is a comment

c)

/* this is a comment */

2.

How to create a numeric variable age with a value of 10

a)

age = 10

b)

age = int(10)

c)

age = "10"

3.

What is the correct extension for python files ?

a)

.py

b)

.pyth

c)

.python

4.

In python, "Hello World" is the same as 'Hello World'

a)

True

b)

False

5.

Which of the below operators can be used to compare two numbers

a)

==

b)

><

c)

=

6.

Which of the following is True

a)

Python is an interpreted language

b)

Python is a compiled language

c)

Python is a scripting language

d)

Python is an Object oriented language

7.

How is a block of code defined in Python ?

a)

with indentation

b)

with paranthesis

c)

with curly braces

8.

Which of the following is true about comments

a)

Comments are used by programmers to document the code

b)

# is used to create a comment in python

c)

''' can be used to create a comment in python

d)

/* */ can be used to crate a comment in python

e)

Python ignores comments.

9.

age = '5'


In the code above, age is a

a)

string

b)

integer

c)

floating point

10.

How do you take input from the user ?

a)

input ()

b)

scanf ()

c)

console ()

d)

all of the above