wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Osnove programskih jezika

Total questions: 20

Worksheet time: 7mins

Name
Class
Date
1.

What is the main advantage of high-level programming languages?

a)

They are faster than low-level languages

b)

They are easier to learn and read

c)

They do not require a compiler or interpreter

d)

They have no syntax rules

2.

What does a compiler do?

a)

Executes code line by line

b)

Translates high-level code to low-level code before execution

c)

Automatically fixes errors in the code

d)

Translates low-level code to high-level code

3.

What type of error occurs when the code is syntactically incorrect?

a)

Runtime error

b)

Syntax error

c)

Semantic error

d)

Logical error

4.

What is the name of the first program usually written in a new language?

a)

"Hello, AI!"

b)

"First Code!"

c)

"Hello, World!"

d)

"Start Coding!"

5.

Which tool allows writing and executing Python code in a browser?

a)

VS Code

b)

Jupyter Notebook

c)

Google Colab

d)

Notepad++

6.

Which data type represents an integer in Python?

a)

str

b)

int

c)

float

d)

bool

7.

What does the function int("123.45") do?

a)

Converts string to decimal number

b)

Rounds the number to the nearest integer

c)

Throws an error because the string contains a decimal point

d)

Converts number to string

8.

Which of the following variable names is valid in Python?

a)

2nd_variable

b)

total_amount$

c)

_private_var

d)

last.name

9.

What is the difference between an operator and an operand?

a)

An operator is a symbol for a mathematical operation, and an operand is the value on which the operation is performed

b)

An operand is a symbol for a mathematical operation, and an operator is the value on which the operation is performed

c)

Both are numbers involved in a mathematical operation

10.

What is an operand?

a)

An operand is the value on which the operation is performed

b)

An operand is a symbol for a mathematical operation, and an operator is the value on which the operation is performed

c)

Both are numbers that participate in a mathematical operation

d)

Operators are used only for strings, and operands for numbers

11.

Which mathematical operation is performed using the // operator?

a)

Regular division

b)

Integer division

c)

Exponentiation

d)

Remainder of division

12.

What will be the result of 3 * 'Python'?

a)

9

b)

PythonPythonPython

c)

Code error

d)

'3Python'

13.

What will len([10, 20, 30, 40]) return?

a)

3

b)

4

c)

40

d)

[10, 20, 30, 40]

14.

Which operator is used to check if an element exists in a list?

a)

in

b)

exists

c)

contains

d)

has

15.

What does the append() method do in Python lists?

a)

Deletes an element from the end of the list

b)

Adds a new element to the end of the list

c)

Sorts the list

d)

Deletes the list

16.

Which loop is used when we do not know in advance how many times it will repeat?

a)

for

b)

while

c)

repeat

d)

loop

17.

Which command is used to break a loop in Python?

a)

stop

b)

continue

c)

break

d)

exit

18.

What does the continue statement do in a Python loop?

a)

Stops the execution of the program

b)

Skips the current iteration and goes to the next one

c)

Restarts the loop

d)

Exits the loop

19.

Which operator is used to find the remainder of division?

a)

/

b)

//

c)

%

d)

**

20.

Which expression will check if a number is even?

a)

if number % 2 == 0:

b)

if number / 2 == 0:

c)

if number % 2 != 0:

d)

if number // 2 == 0: