NEW
Font size
WorksheetsProgramming_Grade11_Term3_Week02
Total questions: 10
Worksheet time: 5mins
text = "Hello, World!"
# What does the following code do?
result = text.lower()
Converts text to uppercase
Converts text to lowercase
Reverses the text
Removes whitespace
Extracts the first word
numbers = [1, 2, 3, 4, 5]
# What does the following code do?
result = sum(numbers)
Finds the product of the numbers
Calculates the average of the numbers
Finds the maximum value in the list
Finds the sum of the numbers
Sorts the list in ascending order
text = "Python Programming"
# What does the following code do?
result = text.split()
Joins the words with a comma
Reverses the words
Splits the text into a list of words
Removes spaces
Converts the text to uppercase
numbers = [2, 4, 6, 8, 10]
# What does the following code do?
result = [num * 2 for num in numbers]
Adds 2 to each element
Multiplies each element by 2
Removes even numbers
Finds the square of each element
Appends 2 to the list
text = "Data Science"
# What does the following code do?
result = text.replace("Science", "Analysis")
Appends "Analysis" to the text
Replaces "Science" with "Analysis"
Removes "Data"
Converts to uppercase
Swaps "Data" and "Science"
numbers = [3, 7, 1, 9, 4]
# What does the following code do?
result = sorted(numbers)
Reverses the list
Finds the maximum value
Sorts the list in ascending order
Finds the sum of the numbers
Removes duplicates
text = "Learning Python is fun!"
# What does the following code do?
result = len(text)
Finds the number of words
Counts the number of vowels
Finds the length of the text
Reverses the text
Removes spaces
numbers = [5, 2, 8, 1, 6]
# What does the following code do?
result = max(numbers)
Finds the minimum value
Calculates the average
Finds the sum of the numbers
Finds the maximum value
Sorts the list in descending order
text = "Astana-2024"
# What does the following code do?
result = text.split("-")
Removes spaces
Joins the words
Splits the text into a list using "-" as the delimiter
Reverses the text
Converts to lowercase
numbers = [10, 5, 8, 3, 12]
# What does the following code do?
result = [num for num in numbers if num % 2 == 0]
Removes odd numbers
Doubles each element
Finds the maximum value
Sorts the list in ascending order
Appends 2 to the list
