fopp icon indicating copy to clipboard operation
fopp copied to clipboard

Correct solution is showing up as wrong, or question is unclear about what it is asking for

Open irunestone opened this issue 4 years ago • 2 comments

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

irunestone avatar Jun 14 '20 02:06 irunestone

Looks like you may have an error in your code, actually.

What does it print out for the length of the first word, "The"?

presnick avatar Jun 14 '20 02:06 presnick

Has this issue been resolved?

dsanders12 avatar Aug 24 '21 13:08 dsanders12