Code Lab BetaBUILD. RUN. DISCOVER.
Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
Challenges / 02
Tag Countdown.
Your lesson
Given: tags = ["alpha", "beta", "gamma"]. With for i, tag in enumerate(tags) print f"{i}:{tag}". Then n = 2; while n >= 0 print n and decrease n by 1. Expected output:
0:alpha
1:beta
2:gamma
2
1
0
Links enumerate + f-string with a while countdown. Do not hardcode the whole output.
challenge_02.pyPYTHON
Loading the runtime… The first launch may take a little longer.
… 0/20000
CHECKSSTANDBY
01enumerate walks tags with an f-string
02while decreases n from 2 to 0
03console matches the expected output
…0/10000
ConsoleWrite the code. Bring it online.
›