wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Basics 1

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

A main difference between the terminal and an IDE (Integrated Development Environment) is you can run a program in an IDE instead of going back and forth between windows

a)

True

b)

False

2.

The terminal or text editor cannot run individual lines, so it would not be used to test individual commands.

a)

True

b)

False

3.

The symbols >>> are called

a)

much greater than

b)

the interactive prompt

c)

command

d)

string

4.

In the following: print('Hello World'), the word print is considered the

a)

command

b)

interactive prompt

c)

parameter

d)

string

5.

In the following: print('Hello World'), ('Hello World') is a(n)

a)

command

b)

parameter or argument

c)

interactive prompt

d)

string

6.

In the following: print('Hello World'), 'Hello World' is a(n)

a)

command

b)

interactive prompt

c)

parameter

d)

string

7.

In the following, x = 7 the x would be considered a(n)

a)

command

b)

parameter

c)

string

d)

variable

8.

Variables can be single letters or symbols as well as words

a)

True

b)

False

9.

When designating a variable, if more than one word is used, there needs to be a(n) ____________________ between the words

a)

space

b)

hyphen (-)

c)

hashtag (#)

d)

underscore (_)

10.

What would be the output?

a)

x = 7

b)

x

c)

7

d)

Syntax error

11.

What is the file extension for Python files?

a)

.pyt

b)

.pt

c)

.py

d)

.ptn

12.

What would be the result if Python version 3.*.* were on the screen above >>> and you entered print ('Hello World')

a)

>>>

b)

print: Hello World

c)

Hello World

d)

Syntax Error

13.

#Display welcome message

a)

Is an endline comment that would print above what every string you enterd

b)

Should not ever be entered on the same line as your command

c)

is an endline comment description for developers and programmers and would not print out when the program was run

d)

Pops up when you load Python

14.

Notepad++ is

a)

Is a high level IDE

b)

For HTML only

c)

Runs and debugs code

d)

Is a text editor used by some programmers

15.

Why would print('Waldo's World') result in an error?

a)

" always has to be used

b)

Python thought the ' in Waldo's was closing the argument

c)

' can't be used in Python

16.

Ways to fix the error in print('Waldo's World') (PICK 2)

a)

Put / in front of ' in Waldo's

b)

Use " (double quote) in Waldo's

c)

Use " (double quotes) for the opening quote

d)

put \ in front of ' in Waldo's

17.

The symbol \ is called a(n) _____________ in Python

a)

backslash

b)

interupter

c)

escape character

d)

variable

18.

In Python a whole number

a)

Is a float

b)

Needs to have # ahead of it

c)

Is an integer

d)

Is a decimal

19.

In Python a float is

a)

An Integer

b)

A decimal

c)

A fraction

d)

A whole number

20.

In Python White Space (PICK TWO)

a)

Is visible only in a ext editor

b)

is only visible in an IDE

c)

Can be tabs or spaces

d)

Can indicate a new line instead of a symbol