wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python #1 Grade #7

Total questions: 16

Worksheet time: 8mins

Name
Class
Date
1.

In python the INTEGER data type can be defined as...?

a)

holds numbers with a decimal point

b)

holds alphanumeric data as text

c)

holds whole numbers

d)

holds either ‘true’ or ‘false’

2.

In python the ' FLOAT data type' can be defined as...?

a)

holds whole numbers

b)

holds alphanumerical data

c)

hold either true or false

d)

holds a decimal point in a number

3.

In python the ' STRING data type' can be defined as...?

a)

holds either a true or false value

b)

holds alphanumeric text

c)

hold whole numbers

d)

holds numbers with a decimal point

4.

The statement input allows us to:

 

a)

Input values to the code

b)

Order the imported statements

c)

Read what the user typed

d)

Show there name

5.

Which of the following code is a Python Comment?

 

a)

" this is a comment "

b)

{ this is a comment }

c)

# this is a comment

d)

( this is a comment )

6.

What is a variable?

a)

a type of memory

b)

A memory location where you store values

c)

a type of graphics

d)

Data type

7.

What is a string in Python?

a)

hold whole numbers 

b)

something that ties words together

c)

a long piece of woven material

d)

text, or keyboard characters

8.

What will the output be from the following Python code?

print (Hello world!)

a)

Hello world!

b)

Syntax Error

c)

Hello world

d)

print(Hello world!)

9.

The correct syntax for converting the string x to uppercase is:

a)

x.upper()

b)

X.upper()

c)

upper(x)

d)

x.UPPER[ ]

10.

In Python what is the addition sign?

a)

=

b)

+

c)

/

d)

-

11.

My_name = "Awesome"

My_name in this string is...

a)

prompt

b)

my name

c)

a variable

d)

syntax

12.

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

a)

asterisk *

b)

plus +

c)

forward slash /

d)

equals =

13.

The correct syntax for converting the string myname to lowercase is :

a)

myname_lower(12)

b)

myNAME.lower[ ]

c)

myname.lower( )

d)

myname.upper( )

14.

Let x= "Python", the output of print(x.upper()) is

a)

"PYTHON"

b)

_PYTHON

c)

PYTHON

d)

python

15.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

(name)

d)

name

16.

The correct way to write a variable in Python?

a)

my_variable = 10

b)

my variable = 10

c)

my_variable is 10

d)

my_variable: 10