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.
int("5") return?str(42) return?float("3.14") return?int(3.9) return?str(100) convert 100 to?Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1int('hello') | AError: str + int not allowed | |
| 2x = '5' print(x + 3) | BError: Cannot convert to int | |
| 3int('42') | COutput: 2.5 | |
| 4str(100) | DValid: Returns 42 | |
| 5print(int(3.9)) | EOutput: 3 | |
| 6print(float('2.5')) | FOk: Returns '100' |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
int("5") — Converts the string "5" to the integer 5.~~float("3.14")number = int("42")text = str(100)decimal = float("300")year = input()
year = int(year)score = 95
result = str(score)
print(result)