Skip to content

[Python] Tutorial(1) Download and print "Hello World"

Last Updated on 2021-10-11 by Clay

Python is a very popular program language, easy to learn is a distinguishing feature for it. In addition, Python also has a large development community and a large number of function libraries.

If you want to send messages to the server or client? you can use the module "socket" .

If you want to develop a game? you can use the package "pygame" .

If you want to send an email automatically? you can use the module "smtplib"

If you want to ... you can do anything you want in Python.

There are countless packages! And Python's syntax is very simple and convenient —— so, if you are a beginner for programming, I recommend you to learn Python!

This tutorial post can teach you how to download Python interpreter, and install it, write some code and execute a sample code to print a string on the screen.

And then, our Python tutorial is beginning!


Download & Install

First, we go to this page to download Python: https://www.python.org/downloads/

這張圖片的 alt 屬性值為空,它的檔案名稱為 image.png
You will see a yellow button like this, click to download.

After downloading, go to the download folder, double click the .exe file, select "Next" button step by step, it will be installed!

(Note: If you search for Python in Windows search field, you can find the Python you installed.)


Hello World

For those with programming experience, the first step of learning a new language is to print a "Hello World" string!

Let's take a look at the code below. Try keying this code to see what we print out.

print('Hello World!')


Output:

Hello World!


That's right! The print() function of Python is easy as this!

Remember, you need to add that quotation marks: print('What you want to print').

If there is no quotation marks , then Python can't know that is a "string" (or "str") data type!

Then the basically print tutorial is finished! I hope I can share more for you.


Postscript

This blog chapter is translated by my self website chapter. My English is not good, so if you find something wrong, may be you can remind me =) very thanks.


Read More

Leave a Reply