Complete the code to assign the value 10 to the variable x.
x = [1]The variable x is assigned the number 10 without quotes because it is a number, not a string.
Complete the code to assign the string 'hello' to the variable greeting.
greeting = [1]Strings must be enclosed in quotes. Both single and double quotes work, so both options are correct.
Fix the error in the code to assign the sum of 5 and 3 to the variable total.
total = 5 [1] 3
The plus sign + adds two numbers together. Here, 5 + 3 equals 8.
Fill both blanks to assign the length of the word 'apple' to the variable length.
length = [1]([2])
The len() function returns the number of characters in a string. Here, it counts the letters in 'apple'.
Fill all three blanks to create a dictionary with keys as uppercase letters of words and values as their lengths, only for words longer than 3 letters.
result = [1]: [2] for word in words if len(word) [3] 3}
This dictionary comprehension creates keys by converting each word to uppercase, values as the length of the word, and includes only words longer than 3 letters.