Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to wrap python 3 input?
How to wrap python 3 input?
In Python 3, you can use the escape character' \n' to wrap the input. When the user inputs, pressing the Enter key will automatically trigger the line feed operation. Therefore, just add "\ n" to the input string.

Here is a sample code:

``` python skin

Name = input ("Please enter your name: \n")

Print ("Hello," +name+ "! Welcome to use this program! ”)

```

In the above code, we use the input () function to get the user's input, and add `\ n` to the prompt information to realize the input line break. When the user finishes entering the name, the program will output a welcome message and splice the entered name into the welcome message.

Run the above code, and the output result is:

```

Please enter your name:

Zhang San

Hello, Zhang San! Welcome to use this program!

```

Therefore, when a user enters a name, a line feed operation is automatically triggered.