Complete the code to print a friendly welcome message.
print([1])
The print function needs a string inside quotes to display text. Option A correctly uses quotes.
Complete the code to create a list of numbers from 1 to 5.
numbers = list(range(1, [1]))
The range function goes up to but does not include the end number, so to get 1 to 5, use range(1,6).
Fix the error in the code to check if a number is even.
if number [1] 2 == 0: print("Even")
The modulo operator % gives the remainder. If number % 2 equals 0, the number is even.
Fill both blanks to create a dictionary of word lengths for words longer than 3 letters.
{word: [1] for word in words if len(word) [2] 3}The dictionary maps each word to its length using len(word). The condition filters words longer than 3 using > 3.
Fill all three blanks to create a dictionary with uppercase keys and values greater than 0.
result = {{ [1]: [2] for k, v in data.items() if v [3] 0 }}The keys are converted to uppercase with k.upper(), values are v, and the condition filters values greater than 0 using >.