Which SQL clause is used to sort the result set in ascending or descending order?
What does the len() function in Python do when applied to a string?
- Returns the number of words in the string
- Returns the length of the string
- Converts the string to lowercase
- Checks if the string contains a specific substring
What does the break statement do in a loop?
- Continues to the next iteration of the loop
- Skips the current iteration and continues with the loop
- Executes a specific block of code repeatedly
- Ends the loop and transfers control to the next statement after the loop
Which of the following is a correct syntax for a for loop in Python?
for i = 1 to 5:for i in range(1, 6):for (int i = 1; i <= 5; i++):foreach i in range(5):
How do you remove an element from a Python list by its value?
remove(value)delete(value)discard(value)pop(value)
What does SQL stand for?
- Simple Query Language
- Sequential Question Language
- Structured Query Language
- Systematic Query Logic
What is the purpose of defining a subprogram?
- To create a new data type
- To execute a block of code only once
- To organise code into reusable modules
- To perform mathematical calculations
What is a list in Python?
- A mathematical operation
- A collection of related data
- A reserved keyword
- A data type
What does the len() function do in Python?
- Returns the logarithm of a number
- Converts a value to lowercase
- Returns the length of a string or list
- Checks if a variable is defined
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