wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Fundamentals-01

Total questions: 30

Worksheet time: 16mins

Name
Class
Date
1.

Why do we learn Python?

a)

It's a really big snake

b)

It's the name of a very funny comedy show

c)

It's simple and easy to learn

d)

It's so rare that no one else knows it

2.

What is python programming language named after

a)

Television show called Monty Python

b)

The snake

3.

Python was developed by

a)

Guido Van Rossum

b)

Gallileo

c)

Edison

d)

Thomas

4.

What is the name of the environment in Python that you write your programs and then test them out?

a)

Math

b)

Window

c)

IDLE

d)

CLI

5.

What will the output be from the following code?

print("Hello world!")

a)

"Hello world!"

b)

Hello world!

c)

print(Hello world!)

d)

SyntaxError

6.

What is the name of the programming language we are learning?

a)

Scratch

b)

Pie thin

c)

Pythan

d)

Python

7.

What symbol do you use to make a comment in Python?

a)

%

b)

@

c)

#

d)

*

8.

Insert the missing part of the code below to output "Hello World".

____________("Hello World!")

a)

print

b)

raw_input

c)

x=

d)

string

9.

What is the correct definition for a VARIABLE?

a)

A named reserved memory location to store values

b)

A comment in the program

c)

print command in python

d)

A text value in the program

10.

Which data type represents a whole number?

a)

Float

b)

Boolean

c)

Decimal

d)

Integer

11.

Data type that can only be true or false

a)

int

b)

string

c)

boolean

d)

float

12.

Which operator is used to multiply numbers?

a)

!

b)

&

c)

*

d)

#

13.

In Python, 'Hello', is the same as "Hello"

a)

True

b)

False

14.

print("12"*3)

What would this print?

a)

36

b)

12*3

c)

121212

d)

24

15.

What will the output be from the following code?

print(3+4)

a)

3+4

b)

7

c)

SyntaxError

d)

print(3+4)

16.

Numbers with a decimal point belong to a type called

a)

Integers

b)

float

c)

pointing

d)

decimal

17.

Create a variable named carname and assign the value Volvo to it.

a)

carname = "Volvo"

b)

carname = Volvo

c)

Volvo="carname"

d)

Volvo=carname

18.

In the following code, "city" is an example of a what?


city = "New York"

a)

List

b)

Variable

c)

Array

d)

Number

19.

What symbol is used in python to assign values to a variable?

a)

equals =

b)

plus +

c)

forward slash /

d)

asterisk *

20.

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

21.

Create a variable named x and assign the value 50 to it.

a)

x=50

b)

x="50"

c)

50=x

d)

"50"=x

22.

Create a variable called z, assign x + y to it.

x = 5

y = 10

_______

a)

sum=x+y

b)

z=x+y

c)

x+y=sum

d)

x+y=z

23.

How do you create a variable with the floating number 2.8?

a)

2.8 = x

b)

x=2.8

c)

2.8

d)

x

24.

Which of the following lines has error?

x=15

y=10

difference=x-y

print(diff)

a)

4

b)

3

c)

2

d)

1

25.

Which of the following are not valid variables in Python?

a)

1number

b)

number1

c)

numbe#r1

d)

_number1

26.

Which of the following is correct?

a)

Variable name can start with a digit.

b)

Variable name can start with an underscore or an alphbet.

c)

Variable name can have symbols like: @, #, $ etc.

d)

Variable name can have all numbers

27.

What is used to take input from the user in Python?

a)

cin

b)

scanf()

c)

input()

d)

<>

28.

Solve: 3 + 4 * 5

a)

35

b)

23

c)

17

d)

19

29.

Solve: 5*4+4+20/5

a)

24

b)

28

c)

35

d)

40

30.

Python Command to accept an integer value

a)

input("Enter a number")

b)

int(input("Enter a number"))

c)

input(int("Enter a number"))

d)

intinput("Enter a number")