i dont seem to understand this question, i am lost and confused.
Your code so far
def pin_extractor(poem):
secret_code = ''
lines = poem.split('\n')
# User Editable Region
for line_index, line in enumerate(lines):
words = line.split()
secret_code += str(len(words[line_index]))
# User Editable Region
poem = """Stars and the moon
shine in the sky
white and bright
until the end of the night"""
print(pin_extractor(poem))
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36
so when i print(line_index) it gives me the number of the lines. when i add print(line_index, line) it gives me the actual lines of the poem. what is confusing me is that enumerate lines in line. yet the “line_index” is the one that is the one that is doing the numbering for the lines. so if i would translate the code into a sentence it would be:
create a line_index from lines and enumerate them and add the lines to the variable “line” placing them next to the numbers?