Search code examples
pythonpseudocode

Converting python long input to pseudo code


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.


Solution

  • 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.