Skip to content

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

@irunestone

Description

@irunestone

Error reported in course CSC157 on page https://runestone.academy/runestone/assignments/doAssignment?assignment_id=37756 by user Julia.Hamill juliafhamill@gmail.com
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions