WorksheetsOsnove programskih jezika
Total questions: 20
Worksheet time: 7mins
What is the main advantage of high-level programming languages?
They are faster than low-level languages
They are easier to learn and read
They do not require a compiler or interpreter
They have no syntax rules
What does a compiler do?
Executes code line by line
Translates high-level code to low-level code before execution
Automatically fixes errors in the code
Translates low-level code to high-level code
What type of error occurs when the code is syntactically incorrect?
Runtime error
Syntax error
Semantic error
Logical error
What is the name of the first program usually written in a new language?
"Hello, AI!"
"First Code!"
"Hello, World!"
"Start Coding!"
Which tool allows writing and executing Python code in a browser?
VS Code
Jupyter Notebook
Google Colab
Notepad++
Which data type represents an integer in Python?
str
int
float
bool
What does the function int("123.45") do?
Converts string to decimal number
Rounds the number to the nearest integer
Throws an error because the string contains a decimal point
Converts number to string
Which of the following variable names is valid in Python?
2nd_variable
total_amount$
_private_var
last.name
What is the difference between an operator and an operand?
An operator is a symbol for a mathematical operation, and an operand is the value on which the operation is performed
An operand is a symbol for a mathematical operation, and an operator is the value on which the operation is performed
Both are numbers involved in a mathematical operation
What is an operand?
An operand is the value on which the operation is performed
An operand is a symbol for a mathematical operation, and an operator is the value on which the operation is performed
Both are numbers that participate in a mathematical operation
Operators are used only for strings, and operands for numbers
Which mathematical operation is performed using the // operator?
Regular division
Integer division
Exponentiation
Remainder of division
What will be the result of 3 * 'Python'?
9
PythonPythonPython
Code error
'3Python'
What will len([10, 20, 30, 40]) return?
3
4
40
[10, 20, 30, 40]
Which operator is used to check if an element exists in a list?
in
exists
contains
has
What does the append() method do in Python lists?
Deletes an element from the end of the list
Adds a new element to the end of the list
Sorts the list
Deletes the list
Which loop is used when we do not know in advance how many times it will repeat?
for
while
repeat
loop
Which command is used to break a loop in Python?
stop
continue
break
exit
What does the continue statement do in a Python loop?
Stops the execution of the program
Skips the current iteration and goes to the next one
Restarts the loop
Exits the loop
Which operator is used to find the remainder of division?
/
//
%
**
Which expression will check if a number is even?
if number % 2 == 0:
if number / 2 == 0:
if number % 2 != 0:
if number // 2 == 0:
