Tell us what’s happening:
im not sure why this is throwing back “you should move the existing body of the function into the new for loop.” i have read over the lessons and even googled nesting for statements and my syntax LOOKS right so what am i doing wrong? ![]()
Your code so far
# User Editable Region
def pin_extractor(poems):
for poem in poems:
poems=[poem1, poem2, poem3]
for line_index, line in enumerate(lines):
secret_code = ''
words = line.split()
lines = poems.split('\n')
if len(words) > line_index:
secret_code += str(len(words[line_index]))
else:
secret_code += '0'
return secret_code
# User Editable Region
poem1 = """Stars and the moon
shine in the sky
white and
until the end of the night"""
poem2 = 'The grass is green\nhere and there\nhoping for rain\nbefore it turns yellow'
poem3 = 'There\nonce\nwas\na\ndragon'
# print(pin_extractor(poems))
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:150.0) Gecko/20100101 Firefox/150.0
Challenge Information:
Build a Pin Extractor - Step 17