How do you remove an element from a Python list by its value?
remove(value)delete(value)discard(value)pop(value)
What is the data type of the result of the expression 2.5 + 3 in Python?
Which operator is used for integer division in Python?
What does the return statement do in a Python function?
- Ends the program execution
- Passes data back to the caller and terminates the function
- Skips the current iteration in a loop
- Outputs a message to the console
Which of the following statements is true about the if-elif-else structure?
- Only the
if part is mandatory; elif and else are optional elif must always be followed by an else statementelse must always be followed by an if statement- The
else part is mandatory
Which of the following is an example of a boolean expression in Python?
x = 5result = "True"y > 10float_num = 3.14
What does the term "nested loop" refer to in programming?
- A loop that runs infinitely
- A loop with a condition that is never true
- A loop that skips iterations
- A loop inside another loop
Which operator is used for exponentiation in Python?
What is a database?
- A computer program
- An internet browser
- A type of computer hardware
- A collection of related data
What will be output when this program is executed?