wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PYTHON PROGRAMMING FUNDAMENTALS

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is the output of the following piece of code when executed in Python shell?


>>> a=("Check")*3

>>> a



a)

(‘Check’,’Check’,’Check’)

b)

* Operator not valid for tuples

c)

(‘CheckCheckCheck’)

d)

Syntax error

2.

Which are arithmetic operators?

a)

+

b)

-

c)

>

d)

<

3.

Which of the following cannot be a variable?

a)

_init_

b)

in

c)

it

d)

on

4.

Which one of these is floor division?

a)

//

b)

/

c)

%

d)

None of the above

5.

Python is a general purpose programming language created by

a)

Dennis M. Ritchie

b)

Guido Van Rossum

c)

James Gosling

d)

Bjarne Stroustrup

6.

Expand IDLE

a)

Internal Development Learning Environment

b)

Integrated Development Learning Enforcement

c)

Interactive Development Learning Environment

d)

Integrated Development Learning Environment

7.

Example of valid identifiers

a)

12Name

b)

name$

c)

total-mark

d)

total_marks

8.

A Relational operator is also called as ___________

a)

Arithmetic operator

b)

Logical operator

c)

Assignment operator

d)

Comparative operator

9.

"and, or and not" are ___________________

a)

Arithmetic operator

b)

Logical operators

c)

Assignment operator

d)

Comparative operator

10.

__________are special words that are used by Python interpreter to recognize the

structure of program.

a)

Tokens

b)

Identifiers

c)

Keywords

d)

Operators

11.

Choose the INVALID identifiers from the following

a)

NUmbEr1

b)

1NUMBer

c)

A_B

d)

A&B

12.

________ are data items that have a fixed value

a)

Tokens

b)

Literals

c)

Keyword

d)

Operators

13.

Examples of String Literals

a)

"ABC1273"

b)

nfjdlsj@@$

c)

12638

d)

'7e920938'

14.

Choose the keyword from the following

a)

IF

b)

Else

c)

iF

d)

else

15.

‘If’ is a decision making statement

a)

TRUE

b)

FALSE