Complete the code to print the absolute value of -5 using a built-in function.
print([1](-5))
The abs() function returns the absolute value of a number.
Complete the code to convert the string '123' to an integer using a built-in function.
number = [1]('123') print(number + 1)
The int() function converts a string representing a number into an integer.
Fix the error in the code by completing the blank with the correct built-in function to get the length of the list.
my_list = [1, 2, 3, 4] print([1](my_list))
The built-in function len() returns the number of items in a list.
Fill both blanks to create a dictionary with words as keys and their lengths as values, using built-in functions.
words = ['apple', 'bee', 'cat'] lengths = { [1]: [2] for word in words }
word.upper() or word.lower() as values instead of lengths.len without parentheses.The dictionary comprehension uses the word as the key and len(word) as the value.
Fill all three blanks to create a dictionary with uppercase keys and values that are True if the length is greater than 3.
words = ['dog', 'elephant', 'cat'] result = { [1]: [2] > 3 for [3] in words }
word.lower() instead of uppercase for keys.word instead of len(word) for values.word correctly.The keys are uppercase words, the values check if length is greater than 3, and the loop variable is word.