🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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)
  1. A.30001 info
  2. B.8081 info
  3. C.8081 None
  4. 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 →