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.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1def add(a: int, b: int) -> int: | AA Python function with type hints that show the inputs and the result should be whole numbers | |
| 2for name in names: | Blet age: i32 = 16; | |
| 3Newer languages built for safety can stop some bugs by checking that values are used correctly | Cscore: int = 10 | |
| 4Type hints are an added feature that tell readers and tools what kind of data a variable should hold | DThe type hint says int but the value is text. It should be a number such as 10, or the hint should be str. | |
| 5def greet(name: str) -> int: return "Hi " + name | EReadable syntax that loops through a list in a way that is close to plain English | |
| 6total: int = "ten" | FThe type hint says the function returns an int, but it actually returns a string. The hint should be -> str. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
language trends — Programming languages keep changing. New features and languages aim to make software easier, safer or faster to build, such as readable syntax, type hints and safer languages.def add(a: int, b: int) -> int:
return a + bdef greet(name: str):
print("Hi " + name)if mark >= 50:
print("Pass")price: float = 9.95names = ["Ava", "Liam"]
for n in names:
print(n)