A Journey to Python — Your First Python Program

In this section, Little Snail will introduce you to the simplest and most commonly used Python program - to output a piece of text on the screen.

Python uses the print function to output a piece of text on the screen, and it will automatically wrap after the output ends. Here we have used the print() function in Python, the print()  method is used to print the output

Demonstration effect under IDLE: run print('Hello World!')

It is also possible to put multiple paragraphs of text in one print function:

Note that there will be no automatic line break between the strings of the same print function, and \nthe line break effect can only be seen after adding.

So far our first Python program has been completed, have you learned it, do you think it is very simple 

Let's check your own learning results, and try to make the following rendering

After finishing, let's compare the code of the little snail:

print('~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*') print('
welcome Go to the little snail classroom,')
print('Let's swim in the ocean of knowledge together!')
print('~*~*~*~*~*~*~*~*~*~*~*~*~ *~*~*~*~*~*~*~*')

Guess you like

Origin blog.csdn.net/qq_60633836/article/details/120355543