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/
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
- [Python] Tutorial (1) Download, and print “Hello World”
- [Python] Tutorial (2) Additional, subtraction, multiplication, division, String, Variable
- [Python] Tutorial (3) for-loop, if-else
- [Python] Tutorial (4) break, pass, continue
- [Python] Tutorial (5) Boolean, True, False
- [Python] Tutorial (6) greater than, less than, equal to
- [Python] Tutorial (7) function
- [Python] Tutorial (8) function, default , *args, **kwargs
- [Python] Tutorial (9) lambda
- [Python] Tutorial (10) List, Array of Python
- [Python] Tutorial (11) Tuples, Sets, Dictionary
- [Python] Tutorial (12) Import package: time, datetime, math
- [Python] Tutorial (13) try & except
- [Python] Tutorial (14) os, read and write the file