🎙 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 9 of 10

What does this print? (code)

What does this print?

import re
lines = ['port = 8080', 'key = "AKIAABCDEFGHIJKLMNOP"', 'name = "AKIA"']
print(sum(1 for l in lines if re.search(r"AKIA[0-9A-Z]{16}", l)))
  1. A.0
  2. B.2
  3. C.3
  4. D.1
Answer & explanation

Correct answer: 1

Only the second line has AKIA followed by 16 uppercase letters or digits.

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 →