fopp
fopp copied to clipboard
Correct solution is showing up as wrong, or question is unclear about what it is asking for
Error reported in course CSC157 on page https://runestone.academy/runestone/assignments/doAssignment?assignment_id=37756 by user Julia.Hamill [email protected] Write code to create a list of word lengths for the words in original_str using the accumulation pattern and assign the answer to a variable num_words_list. (You should use the len function).
original_str = "The quick brown rhino jumped over the extremely lazy fox" num_words_list = [] split = original_str.split(" ") for word in split: x = len(split) num_words_list.append(x) print(num_words_list)
I am confused about how this code is wrong. I created a list of the lengths of the words in the string. What is this question asking for if this answer is incorrect? It is badly worded if this is the case
Looks like you may have an error in your code, actually.
What does it print out for the length of the first word, "The"?
Has this issue been resolved?