Challenge 1
Create a type alias named Point for a pair of floating-point coordinates.
print(Point.__value__)
Press Ctrl⌘Enter to check your answer
Practice creating type aliases, using aliases in annotations, and inspecting aliased type expressions.
Challenge 1
print(Point.__value__)
Press Ctrl⌘Enter to check your answer
Challenge 2
def distance(point: Coordinates) -> float:
x, y = point
return (x * x + y * y) ** 0.5
print(distance((3.0, 4.0)))
Press Ctrl⌘Enter to check your answer
Challenge 3
users: UserTable = {1: (1, "Ada")}
print(users)
Press Ctrl⌘Enter to check your answer
Challenge 4
LaterName = str
print(FutureName.__value__)
Press Ctrl⌘Enter to check your answer