Complete the code to get a number from the user.
number = [1]("Enter a number: ")
The input function reads text from the user.
Complete the code to show the message on the screen.
[1]("Hello, friend!")
The print function shows text on the screen.
Fix the error in the code to get a number and print it.
num = [1]("Type a number: ") print(num)
Use input to get user input as text.
Fill both blanks to create a dictionary of word lengths for words longer than 3 letters.
lengths = {word: [1] for word in words if len(word) [2] 3}The dictionary stores each word with its length, but only if the word is longer than 3 letters.
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 }k instead of k.upper() for keys.This dictionary comprehension makes keys uppercase and includes only items with values greater than zero.
