Complete the code to check if a word starts with the given prefix.
if word.[1](prefix): count += 1
The startswith method checks if the word begins with the prefix.
Complete the code to loop through each word in the list.
for [1] in words: if word.startswith(prefix): count += 1
We use word as the variable to represent each element in the list words.
Fix the error in the return statement to return the count.
return [1]
The function should return the variable count which holds the number of words with the prefix.
Complete the code to create a dictionary comprehension counting word lengths for words with prefix.
{word: len(word) for word in words if word.[1](prefix)}The dictionary comprehension uses the word itself as the key (no extra characters), so blank 1 is empty. The condition uses startswith to check the prefix.
Fill all three blanks to create a dictionary of uppercase words with their lengths if they start with prefix.
{word[1]: [2](word) for word in words if word.[3](prefix)}lower instead of upper.endswith instead of startswith.The key is the uppercase version of the word (word.upper()), the value is the length (len(word)), and the condition checks if the word starts with the prefix (startswith).
