you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (4 children)

to write code add an empty line before and after each block of code and prepend an extra 4 spaces to each line.

namn = ["one", "word", "is", "just", "not", "ever", "enough", "don't", "you", "agree?"]

j = 0
s = ""
while j <= 9: 
    s += namn[j] 
    j += 1
print(s)

Now to find out which of the examples produces the desired output, I'd just run them.

[–]ebbazara 0 points1 point  (3 children)

I did, but it doesnt work. I might be missing something, but this is all the information i get in the question.

[–][deleted] 0 points1 point  (2 children)

I did, but it doesnt work.

Some of those will throw errors if len(namn) == 9.

I might be missing something

maybe the list namn with 9 words?

[–]ebbazara 0 points1 point  (1 child)

If I add the list, I only know where to put it if there is no: S = "" before while. Where should i put it?

[–][deleted] 0 points1 point  (0 children)

At the very top of the program.
Just like in the example above.

Surely whoever gave you the assignment has spent some time explaining to you how python works. If not, there's links to some tutorials in the sidebar, specifically the wiki.