Skip to content
Advertisement

Python || Creating new lines based on user input

I am wondering how you can let a given user input create new lines automatically. Like for instance:

JavaScript

Let the user input for example be:

JavaScript

Now I actually want this to be displayed as:

JavaScript

As you can see in the last example, it is creating new lines each time. I know you can create new lines with /n, but not how to import this into user inputs automatically, I hope you understand with the example given above.

Advertisement

Answer

How about this :

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement