🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Type Hints and Dataclasses: all 10 questions

Quiz: Type Hints and Dataclasses · Question 2 of 10

What does - float mean in def area(r: float) - float:?

What does -> float mean in def area(r: float) -> float:?

  1. A.r must be positive
  2. B.The function prints a float
  3. C.The function is meant to return a float
  4. D.The function converts its result to float
Answer & explanation

Correct answer: The function is meant to return a float

The arrow annotates the return type.

Can you get the rest right without peeking?

Take the timed Quiz: Type Hints and Dataclasses quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →