0
example = example + str(i + 1) + ": " + input("Example: ") + "\n"

the code above is giving me trouble converting it to pseudo code. I have tried doing something like : take user input for the example, add the example number at the start. Store it in a string on separate lines.

What i tried doesn't look right and sitting around for a few minutes i have concluded that i need some help.

1
  • What do you mean by convert to pseudo code? You mean explain what that line does in words? Commented May 26, 2016 at 7:00

1 Answer 1

1

Assuming example = "" and you are looping over some i value, and rewriting like so

example += str(i + 1) + ": " + input("Example: ") + "\n"

You can say "append a new line starting with the next number in the sequence followed by user input"

In terms of pseudo code, I don't really see what needs converted. That one line is pretty concise.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.