← Quiz: Secrets and Configuration: all 10 questions
Quiz: Secrets and Configuration · Question 3 of 10
What does this print? (code)
What does this print?
env = {"PORT": "8080"}
port = int(env.get("PORT", "3000"))
level = env.get("LOG_LEVEL", "info")
print(port + 1, level)
- A.30001 info
- B.8081 info
- C.8081 None
- D.An error
Answer & explanation
Correct answer: 8081 info
PORT is present and converted to 8080; LOG_LEVEL is missing, so the default "info" is used.
Can you get the rest right without peeking?
Take the timed Quiz: Secrets and Configuration quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →