[It's not too late to learn Python from 2020] Part 3 Python Language Basic (1)

learning_times = 2
#Judgment by the number of studies
if learning_times > 0:
    print("Congratulations, your Python journey has begun!")

Birth of Python

** Python ** was born in 1990. Guido van Rossum of the Netherlands was involved in the development project of the educational language "ABC" and then developed ** Python **. However, the development of ** Python ** (Python) started in December 1989 as "Christmas time killing". The development of modern super-major programming languages started in a surprising way. image.png

Features of Python

** Python ** is a general-purpose high-level language with the following features.

--Grammar simplification --Can be written with a small number of lines of code --Code is highly readable, easy to read and easy to write --Available for free on the internet ――The main body is the minimum necessary, and a rich and large-scale tool group specialized in various areas such as standard libraries, third-party libraries, and functions is prepared. --Compatible with many hardware and OS (platform) --You can write programs in object-oriented, imperative, procedural, functional, etc. formats. --A dynamically typed language with reference counting-based automatic memory management (garbage collector) image.png

Python version

The main versions of Python are 2.x and 3.x. 2.x has recently expired and the current Python base is 3.x.

2.x support deadline

version Release date Support deadline
2.0 October 16, 2000
2.1 April 15, 2001
2.2 December 21, 2001
2.3 July 29, 2003
2.4 November 30, 2004
2.5 September 19, 2006
2.6 October 1, 2008 October 29, 2013
2.7 July 4, 2010 January 1, 2020

3.x support deadline

version Release date Support deadline
3.0 December 3, 2008 January 13, 2009
3.1 June 27, 2009 April 9, 2012
3.2 February 20, 2011 February 20, 2016
3.3 September 29, 2012 September 29, 2017
3.4 March 16, 2014 March 18, 2019
3.5 September 13, 2015 September 2020
3.6 December 23, 2016 December 2021
3.7 June 27, 2018 June 2023
3.8 October 14, 2019 October 2024

Python 2.x and 3.x grammatical differences

image.png

Grammar highlights

To improve the readability of the code, it is a grammar highlight to display the ** Python ** keywords and each part of the grammar in different colors.

# -*- coding:utf-8 -*-

#1 line comment

"""
Multi-line comment with three double quotes.
"""

'''
Multi-line comment with three single quotes.
'''


class Animal:
    """This is an animal class.
    """

    #Animal name
    name = ''
    #Number of legs
    leg_num = 0

    def __init__(self, name, leg_num):
        self.name = name
        self.leg_num = leg_num

    def tell_name(self):
        """Outputs animal name information.
        """

        print("The name of this animal is:{name}".format(name=self.name))

    def tell_leg_num(self):
        """Outputs information on the number of legs.
        """

        print("The number of legs of this animal is:{leg_num}".format(leg_num=self.leg_num))

The following is the effect written in VS Code. (With explanation) image.png

Recommended Posts

[It's not too late to learn Python from 2020] Part 3 Python Language Basic (1)
[It's not too late to learn Python from 2020] Part 2 Let's create a Python development environment
Go language to see and remember Part 8 Call GO language from Python
Python to switch from another language
Did not change from Python 2 to 3
C language to see and remember Part 2 Call C language from Python (argument) string
C language to see and remember Part 1 Call C language from Python (hello world)
C language to see and remember Part 4 Call C language from Python (argument) double
C language to see and remember Part 5 Call C language from Python (argument) Array
C language to see and remember Part 3 Call C language from Python (argument) c = a + b
Changes from Python 3.0 to Python 3.5
Changes from Python 2 to Python 3.0
Introduction to Python language
It's too troublesome to display Japanese with Vim's python3.
Python basic memorandum part 2
It's not easy to write Python, it's easy to write numpy and scipy
Python basic memo --Part 2
Python basic memo --Part 1
Python regular expression basics and tips to learn from scratch
Python application: Pandas Part 1: Basic
Post from Python to Slack
Cheating from PHP to Python
Anaconda updated from 4.2.0 to 4.3.0 (python3.5 updated to python3.6)
Python Basic Grammar Memo (Part 1)
Switch from python2.7 to python3.6 (centos7)
Connect to sqlite from python
Ported from R language of "Sazae-san's rock-paper-scissors data analysis" to Python
8 services that even beginners can learn Python (from beginners to advanced users)
[Python + heroku] From the state without Python to displaying something on heroku (Part 1)
[Python + heroku] From the state without Python to displaying something on heroku (Part 2)
Call Matlab from Python to optimize
Introduction to Ansible Part 2'Basic Grammar'
Create folders from '01' to '12' with python
Introduction to Python Hands On Part 1
Programming to learn from books May 10
Post from python to facebook timeline
Introduction to Protobuf-c (C language ⇔ Python)
Connect to utf8mb4 database from python
Python (from first time to execution)
Post images from Python to Tumblr
Programming to learn from books May 7
How to access wikipedia from python
Python application: data visualization part 1: basic
Easy Python to learn while writing
Call c language from python (python.h)
Update Python on Mac from 2 to 3