All challenges
Multiple ChoiceIntermediate 30s

typing.Literal

Choose the best answer for: Literal type
Options
  1. 1Literal only works with int values and rejects str
  2. 2Literal is an alias of str and adds no checking
  3. 3Literal['a', 'b'] restricts to specific values
  4. 4Literal is used to declare string literal annotations

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle