Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Basic Programming Concepts Quiz

Total questions: 10

Worksheet time: 8mins

Name
Class
Date
1.

What function is used to convert string values to integers?

a)

int()

b)

str()

c)

float()

d)

bool()

2.

What sequence is used to create a newline at the end of statements?

(a)  

3.

Construct a block of code that asks the user for a number and prints three times that number. There is extra code to watch out for.

4 lines
4.

Which function is used to convert an integer to a string in Python?

a)

int()

b)

float()

c)

list()

d)

str()

5.

What is the output of int('42') in Python?

a)

42

b)

'42'

c)

4.2

d)

Error

6.

Which of the following will raise a ValueError in Python?

a)

int('123')

b)

int('abc')

c)

int(True)

d)

int(5.0)

7.

Why will this code not run?

a)

there has to be a number in the variable

b)

there are supposed to be no spaces in the variable label

c)

there are no caps in variables

8.

What is a series of characters like letters or numbers, used in the context of programming?

a)

function

b)

wake word

c)

variable

d)

string

9.
What is a variable?
a)
A box(memory location) where you store values
b)
a type of graphics
c)
Data type
d)
a type of memory
10.
A variable that holds a whole number
a)
String
b)
boolean
c)
int
d)
float