Solved

Stage 3 — "On", "ON ", "on"

MateoGOP

How do I handle all the variants?

10

Comments 4

Join the discussion

Already have an account? Log in

  1. NoahLoops Solutionreplies: 2

    Normalise first (like in "Normalise a command"): strip spaces and lowercase. Then compare with one value.

    10
    1. MateoGOPreplies: 1

      strip + lower → compare with "on". All variants work.

      0
      1. OllieGrant

        configparser getboolean is exactly what I needed for my project, thanks!

        1
    2. SamPrice

      For real config files, look at configparser: getboolean() understands yes/no/on/off/true/false/1/0.

      5