Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Programming Boot Camp-Quiz I

Total questions: 30

Worksheet time: 16mins

Name
Class
Date
1.

What is machine code?

a)

A low-level programming language consisting of binary digits/bits that the computer reads and understands

b)

A high-level programming language consisting of instruction lists that humans can read and understand

c)

A low-level programming language consisting of hexadecimal digits that make up high-level language instructions

d)

A medium-level programming language consisting of the assembly code designed for the computer processor

2.

What are the four fundamental elements that make a language?

a)

An alphabet, a lexis, phonetics, and semantics

b)

An alphabet, phonetics, phonology, and semantics

c)

An alphabet, a lexis, a syntax, and semantics

d)

An alphabet, morphology, phonetics, and semantics

3.

What do you call a file containing a program written in a high-level programming language?

a)

A code file

b)

A machine file

c)

A source file

d)

A target file

4.

What is true about compilation? (Select two answers)

a)

Both you and the end user must have the compiler to run your code

b)

It tends to be slower than interpretation

c)

The code is converted directly into machine code executable by the processor

d)

It tends to be faster than interpretation

5.

What is the best definition of a script?

a)

It's an error message generated by the interpreter

b)

It's an error message generated by the compiler

c)

It's a text file that contains sequences of zeroes and ones

d)

It's a text file that contains instructions which make up a Python program

6.

Select the true statements. (Select two answers)

a)

Python is a good choice for creating and executing tests for applications

b)

Python is free, open-source, and multiplatform

c)

Python is a good choice for low-level programming, e.g., when you want to implement an effective driver

d)

Python 3 is backwards compatible with Python 2

7.

What is CPython?

a)

It's the default, reference implementation of the C language, written in Python

b)

It's the default, reference implementation of Python, written in the C language

c)

It's a programming language that is a superset of the C language, designed to produce Python-like performance with code written in C

d)

It's a programming language that is a superset of Python, designed to produce C-like performance with code written in Python

8.

What do you call a command-line interpreter which lets you interact with your OS and execute Python commands and scripts?

a)

A console

b)

Jython

c)

A compiler

d)

An editor

9.

What is the expected behavior of the following program?
print("Hello!")

a)

The program will output Hello! to the screen

b)

The program will output "Hello!" to the screen

c)

The program will generate an error message on the screen

d)

The program will output ("Hello!") to the screen

10.

What is the expected behavior of the following program?
prin("Goodbye!")

a)

The program will generate an error message on the screen

b)

The program will output "Goodbye!" to the screen

c)

The program will output Goodbye! to the screen

d)

The program will output ("Goodbye!") to the screen

11.

The \n digraph forces the print() function to:

a)

break the output line

b)

output exactly two characters: \ and n

c)

duplicate the character next to the digraph

d)

stop its execution

12.

The meaning of the keyword parameter is determined by:

a)

the argument's name specified along with its value

b)

its value

c)

its position within the argument list

d)

its connection with existing variables

13.

The value twenty point twelve times ten raised to the power of eight should be written as:

a)

20.12E8

b)

20E12.8

c)

20.12*10^8

d)

20.12E8.0

14.

The 0o prefix means that the number after it is denoted as:

a)

octal

b)

hexadecimal

c)

binary

d)

decimal

15.

The ** operator:

a)

performs exponentiation

b)

performs duplicated multiplication

c)

performs floating-point multiplication

d)

does not exist

16.

The result of the following division:
1 / 1

a)

cannot be evaluated

b)

is equal to 1.0

c)

is equal to 1

d)

cannot be predicted

17.

Which of the following statements are true? (Select two answers)

a)

The ** operator uses right-sided binding.

b)

The right argument of the % operator cannot be zero.

c)

The result of the / operator is always an integer value.

d)

Addition precedes multiplication.

18.

Left-sided binding determines that the result of the following expression:
1 // 2 * 3 is equal to:

a)

0

b)

0.0

c)

0.16666666666666666

d)

4.5

19.

Which of the following variable names are illegal? (Select two answers)

a)

and

b)

TRUE

c)

True

d)

true

20.

The print() function can output values of:

a)

any number of arguments (excluding zero)

b)

not more than five arguments

c)

just one argument

d)

any number of arguments (including zero)

21.

What is the output of the following snippet?
x = 1

y = 2

z = x

x = y

y = z

print(x, y)

a)

2 1

b)

2 2

c)

1 2

d)

1 1

22.

What is the output of the following snippet if the user enters two lines containing 2 and 4 respectively?
x = int(input())

y = int(input())

 

x = x // y

y = y // x

 

print(y)

a)

the code will cause a runtime error

b)

8.0

c)

4.0

d)

2.0

23.

What is the output of the following snippet if the user enters two lines containing 2 and 4 respectively?
x = int(input())

y = int(input())

 

x = x / y

y = y / x

 

print(y)

a)

the code will cause a runtime error

b)

8.0

c)

2.0

d)

4.0

24.

What is the output of the following snippet if the user enters two lines containing 11 and 4 respectively?
x = int(input())

y = int(input())

 

x = x % y

x = x % y

y = y % x

 

print(y)

a)

1

b)

2

c)

3

d)

4

25.

What is the output of the following snippet if the user enters two lines containing 2 and 4 respectively?
x = int(input())

y = int(input())

 

print(x + y)

a)

24

b)

6

c)

4

d)

2

26.

What is the output of the following snippet?
x = 1 / 2 + 3 // 3 + 4 ** 2

print(x)

a)

8

b)

17

c)

8.5

d)

17.5

27.

What is the output of the following snippet?
y = 2 + 3 * 5.

print(Y)

 

a)

17.0

b)

25.

c)

17

d)

the snippet will cause an execution error

28.

What is the output of the following snippet?
z = y = x = 1

print(x, y, z, sep='*')

a)

1 1 1

b)

x y z

c)

x*y*z

d)

1*1*1

29.

What is the output of the following snippet if the user enters two lines containing 3 and 6 respectively?
x = input()

y = int(input())

 

print(x * y)

a)

333333

b)

36

c)

18

d)

666

30.

What is the output of the following snippet if the user enters two lines containing 11 and 4 respectively?
x = int(input())

y = int(input())

 

x = x % y

x = x % y

y = y % x

 

print(y)

a)

1

b)

2

c)

3

d)

4