Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Class X-AI Class Test (Python Basics)

Total questions: 25

Worksheet time: 14mins

Name
Class
Date
1.

Which of the following is used to define a block of code in Python language?

a)

Indentation

b)

Key

c)

Brackets

d)

All of the mentioned

2.

Who developed Python Programming Language?

a)

Wick van Rossum

b)

Rasmus Lerdorf

c)

Guido van Rossum

d)

Niene Stom

3.

Which are arithmetic operators?

a)

+

b)

-

c)

>

d)

<

4.

Examples of String Literals

a)

"ABC1273"

b)

nfjdlsj@@$

c)

12638

d)

'7e920938'

5.

Which of the method used for taking user input?

a)

input()

b)

enter()

c)

user_input()

d)

scanf()

6.

What is the correct way to declare a string in python and assign it a value "Hello"

a)

string newVar("Hello")

b)

newVar = "Hello"

c)

newVar= string"Hello"

7.

How can we create a variable named yourVar and assign it a value of 45 in Python

a)

int yourVar =45

b)

yourVar =45

c)

None of the above

8.

How did Python, the programming language get its name?

a)
From the snake species Python
b)
From the Monty Python's Flying Circus show
c)
Named after its creator, Guido van Rossum
d)
From the Greek word 'Python', meaning 'prophet'
9.

Which of the following is an example of a Python file extension?

a)

py

b)

pi

c)

p

10.

An operator able to check whether two values are NOT equal is coded as:

a)

<>

b)

!=

c)

not ==

11.

Which is the Python logo?

a)
b)
c)
d)
12.

What is the word (command) used to display numbers and text on the screen?

a)

print

b)

input

c)

output

d)

command

13.

Which of these isn't a Logical Operator?

a)

and

b)

or

c)

not

d)

True

14.

The spelling and grammar rules of a programming language is called

a)

GSP

b)

syntax

c)

code

d)

comments

15.

WHAT IS A TOKEN?

a)

SMALLEST UNIT OF A PROGRAM

b)

LITERALS

c)

KEYWORDS, IDENTIFIERS

d)

OPERATORS, PUNCTUATORS / DELIMETERS

e)

ALL OF THE ABOVE

16.
To create a newline at the end of prompt, you can use which of the following expressions?
a)
\new
b)
\n
c)
\break
d)
\return
17.

Is Python a case sensitive language?

a)

No

b)

Yes

18.
What will the output be from the following code?
print("3*4+5")
a)
SyntaxErrror
b)
17
c)
3*4+5
d)
12
19.

10=a

The above statement is valid in Python?

a)

True

b)

False

20.

Which of the following rule of an identifiers (naming variable) is wrong?

a)

First Character should either be an alphabet or an _

b)

Special Characters can't be used

c)

It is case sensitive ie, upper case and lower case are different

d)

Reserved keywords can also be named as an identifiers.

21.

is Python case sensitive when dealing with identifiers?

a)

yes

b)

no

c)

machine dependent

d)

none of these

22.

Which operator is used to multiply numbers?

a)

%

b)

*

c)

x

d)

**

23.

Which operator can be used to compare two values?

a)

=

b)

==

c)

**

d)

All of these.

24.

Which operator is used to assign a value to a variable in Python?

a)

==

b)

<=

c)

=

d)

-=

25.

Which operator is used for exponentiation in Python?

a)

^

b)

//

c)

%

d)

**