Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
len("Hello")?len("Hi")?len("Hello World")?len()?name = "Alice", what is len(name)?Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1len(Hello) | AOk: Returns 0 | |
| 2len('cat', 'dog') | BOutput: 3 | |
| 3n = len('Python') | CValid: n stores 6 | |
| 4len('') | DError: Missing quotes | |
| 5print(len('Hello')) | EOutput: 5 | |
| 6w = 'cat' print(len(w)) | FError: Too many arguments |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
len("Hello") — len() counts characters - len("Hello") gives 5.~~len("Hello World")length = len("Hello")name = "Alice"
result = len(name)
print(result)message = "Hi there"
size = len(message)word = "Python"
length = len(word)
print(length)text = "Hello World"
count = len(text)
print(count)