wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

ByteBattle 2.0 (2)

Total questions: 30

Worksheet time: 23mins

Name
Class
Date
1.

Who created Python?

a)
Dennis Ritchie
b)
James Gosling
c)
Guido van Rossum
d)
Bjarne Stroustrup
2.

Examples of program translators

a)

Compilers

b)

Interpreters

c)

Assemblers

d)

All the above

3.

Hey Aashi, Tara, and Ishika! Let's dive into the world of programming! Can you tell me what IDE stands for?

a)

Integrated Development Environment

b)

Implicit Deployment Environment

c)

Interrogated Development Environment

4.

Hey Arnav and Prisha! Let's have some fun with operators! Binary operators use _____ operands while unary operators use _____ operand. Can you figure it out?

a)

one, one

b)

two, one

c)

two, two

d)

three, two

5.

Hey there, Aanya and Arjun! Let's settle a debate: Is Python case sensitive when it comes to identifiers?

a)

Python treats uppercase and lowercase letters as the same in identifiers.

b)

Yes, Python is case sensitive when dealing with identifiers.

c)

No, Python is not case sensitive with identifiers.

d)

Identifiers in Python are case insensitive.

6.

Hey there, students! Let's have some fun with Python! All keywords in Python are in _________

a)

case insensitive

b)

lowercase

c)

uppercase

7.

Which of the following character is used to give single-line comments in Python?

a)
#
b)
%%
c)
//
8.

Which of the following is a valid way to declare a variable in Python?

a)

var x = 10

b)

x := 10

c)

x = 10

d)

let x = 10

9.

Hey Rohan! Can you help Alisha figure out what the 'len()' function does in Python?

a)

Returns the length of an object

b)

Converts an object to a list

c)

Checks if an object is empty

d)

Creates a new list

10.

What is the output of the following code: print(type(5))?

a)

<class 'int'>

b)

<class 'float'>

c)

<class 'str'>

d)

<class 'list'>

11.

What will be the result of the expression 3.14 + 2 in Python?

a)

5.14

b)

5

c)

3.14

d)

TypeError

12.

What will be the output of the following code: print(type('Hello'))?

a)

<class 'str'>

b)

<class 'int'>

c)

<class 'float'>

d)

<class 'list'>

13.

Which of the following statements is true about the type() function in Python?

a)

It can only be used with numbers.

b)

It returns the type of an object.

c)

It can modify the type of an object.

d)

It is used to create new types.

14.

What is the output of the following code: print(type(3.14))?

a)

<class 'float'>

b)

<class 'int'>

c)

<class 'str'>

d)

<class 'list'>

15.

Which of the following is a mutable datatype in Python?

a)

Tuple

b)

String

c)

List

d)

Integer

16.

What will be the result of the expression 'Hello' + ' World' in Python?

a)

Hello World

b)

TypeError

c)

HelloWorld

d)

None

17.

What will be the result of the expression 5.0 + 3 in Python?

a)

8.0

b)

8

c)

5.0

d)

TypeError

18.

What is the output of the following code: print(2.5 * 4)?

a)

10.0

b)

10

c)

8.0

d)

8

19.

Which of the following statements is true about adding a float and an integer in Python?

a)

It results in a float.

b)

It results in an integer.

c)

It raises a TypeError.

d)

It results in a string.

20.

What will be the output of the following code: print('Python' * 2)?

a)

PythonPython

b)

Python 2

c)

2 Python

d)

TypeError

21.

What will be the output of the following code: print('Hello' * 3)?

a)

HelloHelloHello

b)

Hello 3

c)

3 Hello

d)

TypeError

22.

What will be the result of the expression 'Python' + 3 in Python?

a)

TypeError

b)

Python3

c)

Python 3

d)

None

23.

What will be the output of the expression len('Python') in Python?

a)

6

b)

5

c)

TypeError

d)

None

24.

What is the order of precedence in python?

a)

Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

b)

Exponential, Parentheses, Division, Multiplication, Addition, Subtraction

c)

Parentheses, Exponential, Multiplication, Division, Subtraction, Addition

d)

Parentheses, Exponential, Multiplication, Division, Addition, Subtraction

25.

What will be the output of the following Python code snippet if x=1?

x<<2

a)
4
b)
1
c)
2
d)
8
26.

What will be the output of the following code: print(2 + 3 * 4)?

a)

20

b)

14

c)

12

d)

5

27.

What will be the result of the expression 5 == 5.0 in Python?

a)

True

b)

False

c)

TypeError

d)

None

28.

Which of the following is the truncation division operator in Python?

a)
/
b)
%
c)
**
d)
//
29.

What arithmetic operators cannot be used with strings in Python?

a)
Addition (+)
b)
Multiplication (*)
c)
Exponentiation (**)
d)

modulus(%)

30.

What is the maximum possible length of an identifier in Python?

a)
79
b)
50
c)
100
d)
120