久久精品国产精品国产精品污,男人扒开添女人下部免费视频,一级国产69式性姿势免费视频,夜鲁夜鲁很鲁在线视频 视频,欧美丰满少妇一区二区三区,国产偷国产偷亚洲高清人乐享,中文 在线 日韩 亚洲 欧美,熟妇人妻无乱码中文字幕真矢织江,一区二区三区人妻制服国产

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python初学者_初学者使用Python的完整介绍

發布時間:2023/11/29 python 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python初学者_初学者使用Python的完整介绍 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

python初學者

A magical art of teaching a computer to perform a task is called computer programming. Programming is one of the most valuable skills to have in this competitive world of computers. We, as modern humans, are living with lots of gadgets such as smartphone, computers and much more digital inventions. One must agree that gadgets are nothing without programming.

教導計算機執行任務的神奇藝術稱為計算機編程。 在這個競爭激烈的計算機世界中,編程是最有價值的技能之一。 作為現代人類,我們生活在許多小工具中,例如智能手機,計算機和更多數字發明。 必須同意,如果沒有編程,則小工具一無是處。

Even though the programming languages started to evolve only before half a century ago, the rate of growth was very huge compared to any other man-made things. In this article, I will teach you my favorite language Python and how to learn a language.

即使編程語言僅在半個世紀之前才開始發展,但與任何其他人造事物相比,其增長速度還是非常巨大的。 在本文中,我將教您我最喜歡的語言Python以及如何學習語言。

Photo by Austin Chan on Unsplash由Austin Chan 攝于Unsplash

先做這個... (Do this first…)

Why do you want to learn to program?

為什么要學習編程?

Think deeply before reading further. I asked the same question to my students on the first day of a programming class. Most of the answers were the same as the following statements.

在進一步閱讀之前,請深思。 在編程課程的第一天,我向我的學生問了同樣的問題。 大多數答案與以下陳述相同。

“ I want a good job in a well-reputed software company so I need to learn a programming language ”

“我想在一個聲譽良好的軟件公司中找到一份好工作,所以我需要學習一種編程語言”

“ Learning a programming language will make me able to learn some advanced technologies like artificial intelligence and machine learning ”

“學習編程語言將使我能夠學習一些先進技術,例如人工智能和機器學習”

The major reason to learn a programming language is to get a job with a good salary or to learn more about some advanced technologies. If you are familiar with some tutorial websites and online courses, then you may know that they start the tutorial by writing the applications of the language.

學習編程語言的主要原因是獲得一份高薪的工作或更多地了解一些先進技術。 如果您熟悉某些教程網站和在線課程,那么您可能知道他們通過編寫該語言的應用程序來開始教程。

Learning with a purpose is not the right way. This is not going to be the right approach as that is followed by everyone. If you need to learn something do it with passion. While doing something, if it fills your heart with enthusiasm then you are in the right path.

有目的的學習不是正確的方法。 這不是每個人都遵循的正確方法。 如果您需要學習一些東西,那就去做吧。 在做某事時,如果它充滿熱情,那么您就走對了。

“Programming is not a subject. It is a basic ability of human brain.”

“編程不是主題。 這是人腦的基本能力。”

If you are a complete beginner to this language, try to learn it with your whole heart. This article is not going to make you a great developer. Only thing I can swear you that you will learn programming is a language of nature.

如果您是該語言的完整入門者,請嘗試全心學習。 本文不會使您成為一名出色的開發人員。 我只能向你發誓,你將學習編程是自然的語言。

為什么要使用Python? (Why Python among others?)

In this world, there are more than seven hundred programming languages available. But not everything gets noticed by all. I have started to learn programming in 2015. I just started with the language C. I still have respect on the C language. But, when I started learning python in 2019 I loved the language very much. The love is still alive. I don’t know the reason for that. It may be a clean syntax. It may be the high readability of code. But something attracted me to stick with that language. I promise you that you will love the language and how it responds to the problems.

在這個世界上,有超過七百種編程語言可用。 但是并不是所有人都注意到所有事情。 我從2015年開始學習編程。我剛開始使用C語言。我仍然對C語言敬重。 但是,當我在2019年開始學習python時,我非常喜歡這種語言。 愛情仍然存在。 我不知道原因。 這可能是一種干凈的語法。 這可能是代碼的高可讀性。 但是某種吸引我的地方是那種語言。 我向您保證,您會喜歡這種語言及其對問題的回應。

Look at the quote by its Inventor Guido van Rossum.

查看其發明人Guido van Rossum的報價。

“The joy of coding Python should be in seeing short, concise, readable classes that express a lot of action in a small amount of clear code — not in reams of trivial code that bores the reader to death.”

“編寫Python的樂趣應該在于看到簡短,簡潔,易讀的類,這些類以少量清晰的代碼表達很多動作,而不是讓大量瑣碎的代碼使讀者無聊而死。”

Photo by Hitesh Choudhary on Unsplash Hitesh Choudhary 攝于Unsplash

Among all other languages, Python is worth considering due to its simplicity and readability of code. We, as humans, use many languages to convey some information to others. Programming is language to speak with computers. If you are looking for a computer language that is same as a human language then Python is the first choice.

在所有其他語言中,Python因其簡單性和代碼可讀性而值得考慮。 作為人類,我們使用多種語言向他人傳達某些信息。 編程是與計算機交談的語言。 如果您正在尋找與人類語言相同的計算機語言,那么Python是首選。

When you are speaking with someone, you don’t need to mention what type of information you are speaking about. The person who is hearing your talk can understand that without any external aid. Python works in the same way. Not like other popular languages, It works great without declaring the data type.

與某人交談時,無需提及您要談論的信息類型。 聽到您講話的人可以理解,而無需任何外部幫助。 Python的工作方式相同。 與其他流行語言不同,它無需聲明數據類型就可以很好地工作。

The following topics will be covered in this article. This will help you to know most of the basic things in programming.

本文將介紹以下主題。 這將幫助您了解編程中的大多數基本知識。

💥 How to Print something in Python?

如何在Python中打印內容?

💥 Concept of using Variable name

Variable使用變量名的概念

💥 Data Types in Python

Python Python中的數據類型

💥 Comments in Python

Python Python中的注釋

💥 Operators and Their functions

💥運算符及其功能

💥 Decision Making and Repetition

💥決策與重復

💥 Looping statements

💥循環語句

💥 Strings in Python

Python Python中的字符串

💥 List in Python

Python Python清單

💥 Tuple in Python

Python Python中的元組

💥 Set in Python

in用Python設置

💥 Dictionary in Python

💥Python中的字典

💥 Functions in Python

Python Python中的函數

💥 Object Oriented Programming

Or面向對象編程

💥 File System in Python

Python Python中的文件系統

如何在Python中打印內容? (How to Print something in Python?)

A program should able to tell something to the user after compiling the code. The computer will give some data after getting some set of instruction from the user. The data given by the computer is called output. The instructions are written using programing language. A computer processor will process the information and gives the output in human understandable form.

程序在編譯代碼后應該能夠告訴用戶一些信息。 在從用戶那里獲得一些指令集之后,計算機將提供一些數據。 計算機提供的數據稱為輸出。 這些指令是使用編程語言編寫的。 計算機處理器將處理該信息,并以人類可以理解的形式給出輸出。

Python follows a technique called interpretation to do this. There are many opensource and commercial IDEs are available. You can use some online interpreters such as repl.it. Click the following link to practice the code examples.

Python遵循一種稱為解釋的技術來執行此操作。 有許多開源和商業IDE。 您可以使用一些在線解釋器,例如repl.it。 單擊以下鏈接練習代碼示例。

Repl.it Python復制Python

https://repl.it/languages/python

https://repl.it/languages/python

Imagine, computer as your friend. Look at the imaginary conversation between two friends meeting each other in a park.

想象一下,計算機是您的朋友。 看看兩個朋友在公園里見面時的假想對話。

Person 1 : Hello. {Statement - Information}

人1: 你好。 {聲明-信息}

Person 1 : Do you remember me? {Question}

第一個人: 你還記得我嗎? {題}

Person 2 : Sorry. I don’t remember you. {Statement - Reply}

第二個人: 對不起。 我不記得你了 {聲明-回復}

Person 2: May I know your name, please ? {Question}

第二個人: 請問您叫什么名字? {題}

Person 1: I am Felix. {Statement - Reply}

人1: 我是費利克斯。 {聲明-回復}

Person 1: We studied in high school together. {Statement - Information}.

人1: 我們一起在高中學習。 {聲明-信息}。

This is a simple conversation between two persons. If you can understand the definitions given at the end of each dialogue , then you can understand how a program works. A computer program may have a input and gives us at least one output from that.

這是兩個人之間的簡單對話。 如果您可以理解每次對話末尾給出的定義,那么您可以了解程序的工作方式。 一個計算機程序可能有一個輸入,并從中提供至少一個輸出。

The output screen in the development environment is called a console. We can able to print something in the console using two different methods. They are print() and input().

開發環境中的輸出屏幕稱為控制臺。 我們可以使用兩種不同的方法在控制臺中打印內容。 它們是print()和input() 。

Take the first line of the conversation. That is a simple information. The sentence does not requires anything from the another node. We can use the keyword print() for this kind of purpose.

進行對話的第一行。 那是一個簡單的信息。 該句子不需要其他節點的任何內容。 為此,我們可以使用關鍵字print() 。

The second line is question that requires a response from the another one. This kind of information can be printed using input() method. When we use the input method the user must enter some values in the output console.

第二行是需要另一個回答的問題。 可以使用input()方法打印此類信息。 當我們使用輸入法時,用戶必須在輸出控制臺中輸入一些值。

In practice, print is used for printing some information and the input is used for getting input from the user.

在實踐中, print用于打印某些信息, input用于獲取用戶的輸入。

Always remember one thing. You have to put something after the execution of input statements. Let us re-design the conversation into a program in python.

永遠記住一件事。 您必須在輸入語句執行后放一些東西。 讓我們將對話重新設計為python程序。

print("Hello.")

Output

輸出量

Hello.

This program is used to print the statement without any requirement from the second person or the user. The print function just prints whatever the information passed inside the quotes. We can the print function in different ways. Look at the following code.

該程序用于打印對帳單,而無需第二人稱或用戶的任何要求。 打印功能僅打印引號內傳遞的所有信息。 我們可以用不同的方式打印功能。 看下面的代碼。

print("First Line")print("Second Line")print('''This
is Multi Line''')

Output

輸出量

First Line
Second Line
This
is Multi Line

Before doing something with input() function we have understand the concept of variable.

在使用input()函數進行操作之前,我們已經了解了變量的概念。

使用變量名的概念 (Concept of using Variable Name)

Look at the second line of the conversation. The first person asking a question to the second one. Now, think about your brain. Human brain contains a large collection of memories. When someone asking about your best friend, you will get your friends image in your mind. Right?.

查看對話的第二行。 第一個人向第二個人問一個問題。 現在,考慮一下您的大腦。 人腦包含大量回憶。 當有人問起你最好的朋友時,你會在腦海中浮現出你的朋友形象。 對?。

The brain contains a image of many people. While thinking about your friend you get the correct imagination as your brain stored the memories with some name. In programming the name that addresses a data stored in memory location is called variable.

大腦包含許多人的形象。 在思考您的朋友時,您會得到正確的想象力,因為您的大腦以一些名字存儲了回憶。 在編程時,尋址存儲在存儲器中的數據的名稱稱為變量。

In the above conversation. The second person gives some response which must be stored in the first persons brain. In computer science, this can be done by using input keyword. The syntax for using a variable name is given below.

在上面的對話中。 第二個人給出一些必須存儲在第一個人大腦中的響應。 在計算機科學中,這可以通過使用input關鍵字來完成。 下面給出了使用變量名的語法。

variable_name = value

variable_name = value

or

要么

variable_name = input("Statement")

variable_name = input("Statement")

I hope you understood the importance of input(), print() and Variable name in Python.

我希望您了解Python中input() , print()和Variable name的重要性。

The complete conversation is converted as python program here.

完整的對話在此處轉換為python程序。

print("Hello.")
answer_1 = input("Do you remember me? ")
answer_2 = input("May I know your name, please? ")
print("We studied in high school together.")

Output

輸出量

Hello.
Do you remember me? Sorry. I don't Re remm ember you.
May I know your name, please? I am Felix
We studied in high school together.

Practice the code by your own to know the program get executed by step by step. The darken letters in the output column are typed by the user.

自己練習代碼,以逐步了解該程序。 用戶在輸出列中輸入較暗的字母。

變量命名規則 (Rules for naming a variable)

In python there are set of rules to be followed while creating a variable name.

在python中,創建變量名稱時要遵循一組規則。

? A variable name can have alphabets (A-z), Numbers(0–9) and Underscore( _ ).

variable變量名可以包含字母(Az),數字(0–9)和下劃線(_)。

? A variable name should not start with any number.

?變量名不能以任何數字開頭。

? A variable name cannot have any special characters in it.

variable變量名稱中不能包含任何特殊字符。

? The variable name could not be a keyword in Python.

?變量名稱不能是Python中的關鍵字。

Python中的數據類型 (Data Types in Python)

Let me ask you three questions. What is your name? What is your age? Are you interested in learning Python? After answering these questions, look at the answers. Each answer is in different type. The first is a type of text-based data. The second one is numerical data. The third one is categorical data.

讓我問你三個問題。 你叫什么名字? 你幾歲? 您對學習Python感興趣嗎? 回答這些問題后,請查看答案。 每個答案的類型不同。 第一種是基于文本的數據。 第二個是數值數據。 第三個是分類數據。

Photo by Jason Leung on Unsplash照片由Jason Leung在Unsplash上拍攝

So the basic classification of data types is texts, numbers and yes or no type. The reason for classifying the data is each type behaves differently. From your age, we can calculate the age after two years. But I can’t do the same operation with text-based data. In programming, the text-based data is called a string.

因此,數據類型的基本分類是文本,數字以及是或否類型。 對數據進行分類的原因是每種類型的行為都不同。 根據您的年齡,我們可以計算出兩年后的年齡。 但是我不能對基于文本的數據執行相同的操作。 在編程中,基于文本的數據稱為字符串。

The numerical data can be classified into two types. One is int and another one is float. An int is a whole number whereas the float type is used for numbers with decimal places. The third type is called a boolean data type which contains only two values “True” and “False”.

數值數據可以分為兩種類型。 一個是int ,另一個是float。 int是整數,而float類型用于帶小數位的數字。 第三種類型稱為布爾數據類型,它僅包含兩個值“ True ”和“ False ”。

We have already seen how to get a string from the user and how to print it to the console. Getting a numerical value is also same. But the input value is always in the form of string.

我們已經看到了如何從用戶那里獲取字符串以及如何將其打印到控制臺。 獲取數值也相同。 但是輸入值始終為字符串形式。

Now age is a numerical data. To ask a numerical data, the input command should be passed through the int() . If someone asks for your age, you will say like 25 or 30. The answer is same as the answer for any other questions. But after hearing that answer, your brain will recognize it is a numerical data. This is how our brain works. int() does the same thing in programming.

現在年齡是一個數值數據。 要詢問數值數據,輸入命令應通過int()傳遞。 如果有人問您的年齡,您會說25或30歲。答案與其他任何問題的答案相同。 但是,在聽到這個答案之后,您的大腦就會意識到這是一個數字數據。 這就是我們大腦的工作方式。 int()在編程中做同樣的事情。

age = int(input(what is your age?))
print("Your age is",age)

Output…

輸出…

what is your age? 26
Your age is 26

Try the same for float value with the help of float() .

在float()的幫助下,對float值嘗試相同的操作。

type() keyword

type()關鍵字

type() is used to find the data type of a variable. Consider the following code.

type()用于查找變量的數據類型。 考慮下面的代碼。

name = "Felix"
age = 23
print(type(name))
print(type(age))

Output will be

輸出將是

'str'
'int'

Python注釋 (Comments in Python)

Comments are some statements which are not considered as instruction to the computer. The comments can be used to write developer information or code usage or anything apart from the actual code.

注釋是一些陳述,不被視為對計算機的說明。 注釋可用于編寫開發人員信息或代碼用法或除實際代碼外的任何內容。

The comment will be of two types. Single line comments and multiple line comments.

評論將分為兩種類型。 單行注釋和多行注釋。

Single line comments are created using # .

使用#創建單行注釋。

Multi Line comments are created using ''' Your Comment Here ''' .

多行注釋是使用''' Your Comment Here ''' 。

#Single Line comment
'''This is
a multi line
comment'''

運算符及其功能 (Operators and Their Functions)

Just storing and retrieving data is not enough in programming. Let us look at an example. You are going to a shop to get some chocolates. Now the price of chocolate is 4.99 $. You need ten chocolates in total. After collecting the chocolates you have to pay the bill. Now, how will you calculate the amount?.

在編程中僅存儲和檢索數據是不夠的。 讓我們來看一個例子。 你要去商店買些巧克力。 現在,巧克力的價格為4.99美元。 您總共需要十塊巧克力。 收集完巧克力后,您必須支付賬單。 現在,您將如何計算金額?

Photo by Chris Liverani on Unsplash Chris Liverani在Unsplash上拍攝的照片

In this scenario, we can store the price of the chocolate in a float variable. But we have to multiply the cost into total chocolates to get the total price. This is simple elementary mathematics. But, how can a computer do this?. The use of operators takes place here. There are many operations like multiplication is available in mathematics. To perform those calculations in programming we are using some symbols called operators. A operator usually operates on two different operands.

在這種情況下,我們可以將巧克力的價格存儲在float變量中。 但是我們必須將成本乘以總巧克力才能得出總價。 這是簡單的基礎數學。 但是,計算機如何做到這一點? 在這里使用運算符。 數學中有很多運算,例如乘法。 為了在編程中執行這些計算,我們使用了一些稱為運算符的符號。 一個運算符通常對兩個不同的操作數進行運算。

Let us look at the algorithm for above situation.

讓我們看一下上述情況的算法。

PRICE = 4.99
COUNT = 10
TOTAL = PRICE * COUNT

Here operator is *.

這里的運算符是*。

Major classification of operators in python is listed below.

下面列出了python中運算符的主要分類。

🔹 Arithmetic Operators

🔹算術運算符

🔹 Assignment Operators

🔹賦值運算符

🔹 Comparison Operators

🔹比較運算符

🔹 Logical Operators

🔹邏輯運算符

🔹 Bit Wise Operators

🔹位明智算子

ARITHMETIC OPERATORS

算術運算符

Arithmetic operators are used for basic mathematical operations like addition subtraction, multiplication and division.

算術運算符用于基本的數學運算,例如加減法,乘法和除法。

Let a=30 and b=4.

設a = 30和b = 4。

Arithmetic Operators算術運算符

Python Program for above calculation.

用于上述計算的Python程序。

a = 30
b = 4
print(a + b)
print(a - b)
print(a * b)
print(a / b)
floor = a // b
print(floor)
mod = a % b
power = a ** b
print(mod)
print(power)

Output :

輸出:

34
26
120
7.5
7
2
810000

ASSIGNMENT OPERATORS

轉讓經營者

Assignment operators are used to assign a value to a variable. The main assignment operator is = .

賦值運算符用于為變量賦值。 主要的賦值運算符是=。

In price = 50 , the value 50 is assigned to the price variable.

在price = 50 ,將值50分配給price變量。

a = 50
b = 40
a = 60
print(a)
print(b)

Output:

輸出:

60
40

A variable will always have the value that assigned lastly. In the above program the last assignment for the variable ‘a’ is 60.

變量將始終具有最后分配的值。 在上面的程序中,變量“ a”的最后賦值為60。

Apart from the equal to (=) operator there are some assignment operators called short hand operator. These operators are used to store a value returned from a operation on a particular variable to the variable itself.

除了等于(=)運算符外,還有一些賦值運算符稱為簡寫運算符。 這些運算符用于將從對特定變量的操作返回的值存儲到變量本身。

+= is an example for short hand operator. If we use it in programming the syntax will be a+=b. The actual syntax for this expression is a = a + b. After adding the values of ‘a’ and ‘b’ the result is stored in ‘a’ itself.

+ =是速記員的示例。 如果我們在編程中使用它,語法將為a + = b。 該表達式的實際語法為a = a + b。 將“ a”和“ b”的值相加后,結果將存儲在“ a”本身中。

a = 40
b = 60
a += b
print(a)

Output:

輸出:

100

Try this type of program with other short hand operators like -=, *=, /=, **= //= , %=. Almost all the arithmetic operators supports short hand operation.

與其他速記運算符(例如-=,* =,/ =,** = // =和%=)一起嘗試這種類型的程序。 幾乎所有的算術運算符都支持短手運算。

COMPARISON OPERATORS

比較運算符

Comparison operators are used to compare two variables. All comparison operators will return two things. ‘True’ and ‘False’.

比較運算符用于比較兩個變量。 所有比較運算符將返回兩件事。 '真假'。

Syntax: Operand1 Operator Operand2

語法: Operand1 運算符 Operand2

  • == is equality operator. If both values are equal it will return True otherwise it returns False.

    ==是相等運算符。 如果兩個值相等,它將返回True,否則返回False。
a = 10
b = 10
c = 20
print(a==b)
print(a==c)

Output:

輸出:

True
False
  • != is not equal operator. It acts opposite to the equality operator. This will return True only if the both values are different.

    !=不等于運算符。 它的作用與相等運算符相反。 僅當兩個值都不同時,才返回True。
a = 10
b = 10
c = 20
print(a!=b)
print(a!=c)

Output:

輸出:

False
True
  • > is greater than symbol. If operand1 is greater than operand2, it will return True otherwise zero.

    >大于符號。 如果操作數1大于操作數2,它將返回True,否則返回零。
a = 10
b = 10
c = 20
print(a > b)
print(c > a)
print(a > c)

Output:

輸出:

False
True
False
  • < is lesser than symbol. If operand1 is lesser than operand2, it will return True otherwise zero.

    <小于符號。 如果操作數1小于操作數2,則它將返回True,否則返回零。
a = 10
b = 10
c = 20
print(a < b)
print(c < a)
print(a < c)

Output:

輸出:

False
False
True
  • >= and <= are Greater than or equal to and less than or equal to operators respectively. These operators combines both the operations on > and equality operators. First one returns True if the value 1 is greater or equal to the second value.

    > =和<=分別大于或等于和小于或等于運算符。 這些運算符將>運算符和相等運算符組合在一起。 如果值1大于或等于第二個值,則第一個返回True。
a = 10
b = 10
c = 20
print(a >= b)
print(c >= a)
print(a >= c)

Output:

輸出:

True
True
False

Another example

另一個例子

a = 10
b = 10
c = 20
print(a <= b)
print(c <= a)
print(a <= c)

Output:

輸出:

True
False
True

LOGICAL OPERATORS

邏輯運算符

Logical operators are often used with the conditional statements. There are three logical operators in python. They are and, or and not.

邏輯運算符通常與條件語句一起使用。 python中有三個邏輯運算符。 它們是andor and not

It used between two boolean values.

它在兩個布爾值之間使用。

  • and returns True when both the conditions are same.

    并在兩個條件相同時返回True。

True and True returns True

TrueTrue返回True

True and False returns False

正確錯誤返回False

False and True returns False

FalseTrue返回False

False and False returns True

FalseFalse返回True

a = 10
b = 10
c = 20
print(a==b and c>a) #(True and True)

Output:

輸出:

True
  • or returns True if any one of the value is True.

    或如果任何一個值為True,則返回True。

True and True returns True

TrueTrue返回True

True and False returns True

返回真

False and True returns True

FalseTrue返回True

False and False returns False

錯誤錯誤返回錯誤

a = 10
b = 10
c = 20
print(a==b or a>b) #(True and False)print(a>b or c<b) #(False and False)

Output:

輸出:

True
False
  • not returns opposite of anything.

    返回任何東西相反。

Syntax: not expression

語法:不表達

not True returns False

不正確返回錯誤

not False returns True

不是False返回True

Write your own program for this…. 😉

為此編寫您自己的程序。 😉

決策與重復 (Decision Making and Repetition)

Decision making is an important skill in everyone life. In this part we are going to teach the computers to make decision. Let us imagine a situation. You are driving a car. Suddenly you are noticing that the red light is turned on in the signal. Now, what will you do?. You will apply the brake. Now, you are executing something called driving a car. During the execution, the car must be stopped only if you see the red color. This is an example of decision making. The exact thing can be achieved by decision control statements in Python. The decision control statements are given below.

決策是每個人生活中的一項重要技能。 在這一部分中,我們將教計算機進行決策。 讓我們想象一個情況。 您正在開車。 突然您注意到信號中的紅色指示燈已打開。 現在,你會怎么做? 您將剎車。 現在,您正在執行稱為駕駛汽車的操作。 在執行過程中,只有在看到紅色時才必須停止汽車。 這是決策的一個例子。 確切的事情可以通過Python中的決策控制語句來實現。 決策控制語句如下。

Photo by Javier Allegue Barros on Unsplash Javier Allegue Barros在Unsplash上拍攝的照片
  • if

    如果
  • if…else

    如果別的
  • if…elif…else

    如果……否則……否則
    • if Statement:

      如果聲明:

    if statement will check for a condition. If the condition return True then the statements given in the statements will be executed. Otherwise it do nothing.

    if語句將檢查條件。 如果條件返回True,則將執行語句中給出的語句。 否則它什么也不做。

    Syntax: if condition:

    語法: if條件:

    States: if True or if False. These are the two states in if condition. We have studied about various operators and expressions. After passing the expressions it will return True or False. If the returned value is True then the statements in that condition will be executed.

    狀態:如果為True或False。 這是if條件下的兩個狀態。 我們研究了各種運算符和表達式。 傳遞表達式后,它將返回True或False。 如果返回值為True,則將執行該條件下的語句。

    Example: Let a =10 and b = 20.

    示例:令a = 10且b = 20。

    Here if a<b: means if True: so that the statements in the if block is executed.

    這里,如果a <b:表示是否為True:則執行if塊中的語句。

    a = 10
    b = 5
    if a>b:
    print("if condition satisfied")
    print("Hello")

    Output:

    輸出:

    if condition satisfied
    Hello
    • if … else

      如果別的

    In the previous one if the expression becomes if False: Then nothing will be executed. The else keyword makes it possible. If the condition in the ‘if’ is False then the statements in else part will be executed.

    在上一個表達式中,如果表達式變為False:則不執行任何操作。 else關鍵字使之成為可能。 如果“ if”中的條件為False,則將執行else部分中的語句。

    a = 10
    b = 5
    if a>b:
    print("If is executed")
    else:
    print("else is executed")

    Output:

    輸出:

    If is executed
    • if … elif … else

      如果... elif ...否則

    If you have more than one conditions in your program, then this type of nested condition is used.

    如果程序中有多個條件,則使用這種嵌套條件。

    a = 1
    b = 2
    c = 3
    if a>b and a>c:
    print("a is greater")
    elif b>a and b>c:
    print("b is greater")
    else:
    print("c is greater")

    After using : in if, elif and else expressions the statements must be given after 4 spaces in the next line. This is called indentation.

    在if,elif和else表達式中使用:之后,必須在下一行的4個空格后給出語句。 這稱為縮進。

    循環報表 (LOOPING STATEMENTS)

    Looping or repeating the same type of operations again and again is important thing in programming. This kind of approach is called looping.

    在編程中一次又一次地循環或重復相同類型的操作是很重要的。 這種方法稱為循環。

    Tine Ivani? on TineIvani?攝于UnsplashUnsplash

    There are two types of keyword available in python. One is while and another on is for.

    python中有兩種可用的關鍵字。 一個是一會兒,另一個是為。

    • while:

      而:

    Syntax: while expression:

    語法: while表達式:

    The statements in the while block will be executed until the expression returns True each time.

    while塊中的語句將一直執行,直到每次表達式返回True為止。

    a = 5
    while a>0:
    print(a)
    a = a-1
    print("while loop executed")

    Output:

    輸出:

    5
    4
    3
    2
    1
    while loop executed

    Each time the value returned from the expression is changing. Here at on point a will become 0. Now a>0 is False. When the while loop becomes False the execution will be stopped.

    每次從表達式返回的值都會改變。 在這里,a將變為0。現在a> 0為False。 當while循環變為False時,將停止執行。

    • for loop

      for循環

    Syntax: for variable in sequence:

    語法:對于順序 變量 :

    There are many sequence types available in python. But for now let us create a sequence with range() keyword.

    python中有許多可用的序列類型。 但是現在讓我們創建一個帶有range()關鍵字的序列。

    for x in range(5):

    對于范圍x中的x(5):

    In this expression, the range(5) will create a sequence from 0 to 4. Each time the consecutive numbers are assigned to the variable x.

    在此表達式中,range(5)將創建一個從0到4的序列。每次將連續數字分配給變量x。

    a = 5
    for x in range(a):
    print(x)
    print("for loop executed")

    Output:

    輸出:

    0
    1
    2
    3
    4
    for loop executed

    字符串的結構 (Structure of String)

    In Python, string is a collection of uni-code characters arranged in a sequence. Each character of a string is placed in continuous positions called index. We can access the characters with the help of the index. The following diagram illustrates how the string “Happy Coding” is arranged using indexes.

    在Python中,字符串是按順序排列的Unicode字符的集合。 字符串的每個字符都放置在稱為index連續位置中。 我們可以在索引的幫助下訪問字符。 下圖說明了如何使用索引來排列字符串“ Happy Coding”。

    Python allows both positive and negative indexing for the string. The index always starts with 0 in positive indexing.

    Python允許對字符串進行正向和負向索引。 在正索引中,索引始終以0開頭。

    The first Character can be accessed with the indexes 0 and -12 in this string.

    可以使用該字符串中的索引0和-12訪問第一個字符。

    如何創建一個字符串變量? (How to Create a String Variable?)

    Creating a string variable is very simple. You can just assign a string to a variable name directly or by getting input from user. We know that a string can be printed directly in the console without any variable names in the following methods.

    創建字符串變量非常簡單。 您可以直接將字符串分配給變量名,也可以從用戶那里獲取輸入。 我們知道,在以下方法中,無需任何變量名即可直接在控制臺中打印字符串。

    print("I am a String")
    or
    print('I am a String')
    or
    print("""I am also a String""")
    orprint('''Me too....''')

    A string variable created by the following syntax.

    通過以下語法創建的字符串變量。

    variable_name = “String”

    variable_name = “String”

    Syntax for String Creation創建字符串的語法

    To print the string, you don’t need to use any quotes. print(variable_name) is enough. Here is an example for creating string variable and printing it using Python.

    要打印字符串,您不需要使用任何引號。 print(variable_name)就足夠了。 這是創建字符串變量并使用Python打印它的示例。

    name = "Felix Antony"
    print(name)

    Output:

    輸出:

    Felix Antony

    訪問字符串中的字符 (Accessing a Character in String)

    I already stated that a character in a string can be accessed using index of a character in the string. Now, I create a string variable called statement which stores the string “Happy Coding” in it.

    我已經說過,可以使用字符串中字符的索引來訪問字符串中的字符。 現在,我創建一個名為statement的字符串變量,該變量在其中存儲字符串“ Happy Coding”。

    statement = "Happy Coding"

    To access a character in a particular index, we have to put the index number inside square brackets [] at the end of variable name.

    要訪問特定索引中的字符,我們必須將索引號放在變量名末尾的方括號[]中。

    Syntax for accessing a character訪問字符的語法

    Look at the following example which prints the characters in particular index.

    請看下面的示例,該示例顯示特定索引中的字符。

    statement = "Happy Coding"
    print(statement[0])
    print(statement[-12])
    print(statement[3])
    print(statement[-5])

    Output:

    輸出:

    H
    H
    p
    o

    如果指數超過…怎么辦? (What if the index exceeds…)

    What will happen, if you put an index that is not available. In the above example the maximum index is 11. So let us check what will happen while trying to access 13th index.

    如果您放置一個不可用的索引,將會發生什么。 在上面的示例中,最大索引為11。因此,讓我們檢查在嘗試訪問第13個索引時會發生什么。

    statement = "Happy Coding"
    print(statement[13])

    Output

    輸出量

    IndexError: string index out of range

    This will create an error. So the Python Interpreter will through an exception on it.

    這將產生一個錯誤。 因此,Python解釋器將通過其上的異常。

    Python中的字符串方法 (String Methods in Python)

    Methods are functions that associated with Objects in Python. In python everything is an object. String is also an object in Python. The string object supports some methods which returns some values after applying the methods on strings.

    方法是與Python中的對象相關聯的函數。 在python中,一切都是對象。 字符串也是Python中的對象。 字符串對象支持某些方法,這些方法將方法應用于字符串后會返回一些值。

    To simplify the concept, I classified the string methods available in python into four different types.

    為了簡化概念,我將python中可用的字符串方法分為四種不同的類型。

    💥 Character Conversion methods

    💥字符轉換方法

    💥 Type Checking Methods

    💥類型檢查方法

    💥 Sub String Methods

    💥子字符串方法

    💥 Alignment Methods

    💥對準方法

    字符轉換方法 (Character Conversion Methods)

    Character conversion methods are used to convert the characters in string into different forms. The available character conversion methods for strings in python are given below.

    字符轉換方法用于將字符串中的字符轉換為不同形式。 下面給出了python中字符串可用的字符轉換方法。

    🎲 capitalize()

    🎲capitalize()

    🎲 casefold()

    🎲casefold()

    🎲 swapcase()

    🎲swapcase()

    🎲 upper()

    🎲upper()

    🎲 lower()

    🎲lower()

    🎲 title()

    🎲title()

    🔖 capitalize() Method

    ize capitalize()方法

    capitalize() Method converts the first character of a string to upper case. It doesn’t make any change if the first character is already in capitalized.

    capitalize()方法將字符串的第一個字符轉換為大寫。 如果第一個字符已經大寫,則不會進行任何更改。

    Syntax for capitalize( ) method大寫()方法的語法 string = "i love Python"
    print(string.capitalize())orstring = "i love Python"
    string = string.capitalize()
    print(string)

    Both program will give same outputs

    兩個程序將給出相同的輸出

    I love Python

    🔖 casefold() Method

    🔖casefold()方法

    casefold() method is used to convert all the uppercase characters in a string into lower case characters.

    casefold()方法用于將字符串中的所有大寫字符轉換為小寫字符。

    Syntax for casefold( ) methodcasefold()方法的語法 string = "hApPy CoDinG"
    print(string.casefold())

    Output

    輸出量

    happy coding

    🔖 swapcase() Method

    case swapcase()方法

    swapcase() method is used to convert the uppercase letters into lower case letters and lower case letters into uppercase letters.

    swapcase()方法用于將大寫字母轉換為小寫字母,并將小寫字母轉換為大寫字母。

    Syntax for swapcase( ) methodswapcase()方法的語法 string = "hAPPY cODING"
    print(string.swapcase())

    Output

    輸出量

    Happy Coding

    🔖upper() Method

    🔖upper()方法

    upper() is a string method which is used to capitalize all the characters in a string.

    upper()是一個字符串方法,用于大寫字符串中的所有字符。

    Syntax for upper( ) methodupper()方法的語法 string = "Hello Python"
    print(string.upper())

    Output:

    輸出:

    HELLO PYTHON

    🔖lower() Method

    🔖lower()方法

    lower() is also a string method which is used to convert the entire string into lowercase letters.

    lower()也是一個字符串方法,用于將整個字符串轉換為小寫字母。

    Syntax for lower( ) methodlower()方法的語法 string = "Hello Python"
    print(string.lower())

    Output

    輸出量

    hello python

    🔖title() Method

    🔖title()方法

    title() method converts the first characters of all the words in String.

    title()方法轉換String中所有單詞的首字符。

    Syntax for title( ) methodtitle()方法的語法 string = "hello python"
    print(string.title())

    Output

    輸出量

    Hello Python

    類型檢查方法 (Type Checking Methods)

    The string method used for checking the type of character in python is known as type checking methods. The type checking methods are listed below.

    用于檢查python中字符類型的字符串方法稱為類型檢查方法。 類型檢查方法如下所示。

    🎲 isalpha()

    🎲isalpha()

    🎲 isnumeric()

    🎲isnumeric()

    🎲 isalnum()

    🎲isalnum()

    🎲 isupper()

    🎲isupper()

    🎲 islower()

    low islower()

    🎲 isidentifier()

    🎲isidentifier()

    🎲 istitle()

    🎲istitle()

    🎲 isspace()

    🎲isspace()

    🔖isalpha() Method

    🔖isalpha()方法

    isalpha() method is used to check all the characters in a string are alphabets. This method return True when all the characters are alphabets.

    isalpha()方法用于檢查字符串中的所有字符是否都是字母。 當所有字符均為字母時,此方法返回True。

    Syntax for isalpha( ) methodisalpha()方法的語法 string = "hello"
    print(string.isalpha())

    Output

    輸出量

    True

    🔖isnumeric() Method

    🔖isnumeric()方法

    isnumeric() method returns True if all the characters in the string are numbers.

    如果字符串中的所有字符均為數字,則isnumeric()方法返回True。

    Sytax for isnumeric( ) methodisnumeric()方法的語法 string = "1234"
    print(string.isnumeric())

    Output

    輸出量

    True

    🔖isalnum() Method

    🔖isalnum()方法

    isalnum() metthod returns True if the characters in a string are alphabets or numbers or combination of both.

    如果字符串中的字符是字母,數字或兩者的組合,則isalnum()方法返回True。

    Syntax for isalnum( ) methodisalnum()方法的語法 string = "str123"
    print(string.isalnum())

    Output

    輸出量

    True

    🔖isupper() and islower() Methods

    upisupper()和islower()方法

    isupper() method returns True if all the characters in a string are uppercase letters whereas islower() will return True if all the characters are lowercase letters.

    如果字符串中的所有字符均為大寫字母,則isupper()方法返回True;而如果所有字符均為小寫字母,則islower()將返回True。

    Syntax for isupper( ) methodisupper()方法的語法 Syntax for islower( ) methodislower()方法的語法 string1 = "HELLO"
    string2 = "python"
    print(string1.isupper())
    print(string2.islower())

    Output

    輸出量

    True
    True

    🔖isidentifier() Method

    identisidentifier()方法

    isidentifier() Method is used to check whether a string can be an identifier or not. We have already seen the conditions to follow while creating a variable name in our previous article. This method return True if the string can be a identifier.

    isidentifier()方法用于檢查字符串是否可以是標識符。 在上一篇文章中,我們已經看到了在創建變量名時要遵循的條件。 如果字符串可以是標識符,則此方法返回True。

    Syntax for isidentifier( ) methodisidentifier()方法的語法 string1 = "var_1"
    string2 = "2var"
    print(string1.isidentifier())
    print(string2.isidentifier())

    Output

    輸出量

    True
    False

    🔖isspace() Method

    spaceisspace()方法

    If all the characters in a string are white spaces, then isspace() method will return True.

    如果字符串中的所有字符都是空格,則isspace()方法將返回True。

    Syntax for isspace( ) methodisspace()方法的語法 string = " "
    print(string.isspace())

    Output

    輸出量

    True

    🔖istitle()

    🔖istitle()

    istitle() is used to check whether a string is a title or not.

    istitle()用于檢查字符串是否為標題。

    Syntax for istitle( ) methodistitle()方法的語法 string = "Hello Python"
    print(string.istitle())

    Output

    輸出量

    True

    基于子字符串的方法 (Sub String Based Methods)

    A part of string is called sub string. Consider the string ‘cat’. The sub strings of this string are, ‘c’, ‘a’, ‘t’, ‘ca’, ‘at’, ‘cat’. There are some methods are available based on the sub string processing in Python.

    字符串的一部分稱為子字符串。 考慮字符串“ cat”。 該字符串的子字符串為“ c”,“ a”,“ t”,“ ca”,“ at”,“ cat”。 有一些基于Python中子字符串處理的方法。

    🎲 count()

    🎲count()

    🎲 startswith()

    🎲startswith()

    🎲 endswith()

    with endswith()

    🎲 find()

    🎲find()

    🎲 rfind()

    🎲rfind()

    🎲 index()

    🎲index()

    🎲 rindex()

    🎲rindex()

    🎲 replace()

    🎲replace()

    🔖 count() Method

    🔖count()方法

    count() method is used to count the number of time a sub string occurs in a string.

    count()方法用于計算子字符串在字符串中出現的時間。

    Syntax for count( ) methodcount()方法的語法 string = "I am learning Python"
    print(string.count("a"))

    Output

    輸出量

    2

    🔖 startswith() Method

    🔖startswith()方法

    startswith() method is used to check whether a string is starting with the given sub string or not.

    startswith()方法用于檢查字符串是否以給定的子字符串開頭。

    Syntax for startswith( ) methodstartswith()方法的語法 string = "Happy Coding"
    print(string.startswith("Hap"))

    Output

    輸出量

    True

    🔖 endswith() Method

    🔖endswith()方法

    endswith() method returns True if the string ends with the given sub string.

    如果字符串以給定的子字符串結尾,則endswith()方法返回True。

    Syntax for endswith( ) methodendswith()方法的語法 string = "Happy COding"
    print(string.endswith("ing"))

    Output

    輸出量

    True

    🔖 index() and find() Methods

    🔖index()和find()方法

    index() and find() methods are used to find the index of the sub string where it occurs for the first time. The only difference between the both is find() will return -1 if the sub string is not available in the string whereas the index() method creates an exception.

    index()和find()方法用于查找第一次出現的子字符串的索引。 兩者之間的唯一區別是,如果子字符串在字符串中不可用,則find()將返回-1,而index()方法將創建一個異常。

    Syntax for index( ) methodindex()方法的語法 Syntax for find( ) methodfind()方法的語法 string = "I love Python"
    print(string.index("o"))
    print(string.find("o"))

    Output

    輸出量

    3
    3

    Another Example

    另一個例子

    string = "I love Python"
    print(string.index("q"))
    print(string.find("q"))

    Output

    輸出量

    ValueError: substring not found
    -1

    🔖 rindex() and rfind()

    🔖rindex()和rfind()

    These methods works as same as index() and find() methods. But It returns the index at which a sub string occurs for the last time in the string.

    這些方法與index()和find()方法相同。 但是,它返回字符串中最后一次出現子字符串的索引。

    Syntax for rindex( ) methodrindex()方法的語法 Syntax for rfind( ) methodrfind()方法的語法 string = "I love Python"
    print(string.rindex("o"))
    print(string.rfind("o"))

    Output

    輸出量

    11
    11

    🔖 replace() Method

    🔖replace()方法

    Syntax for replace( ) methodreplace()方法的語法 string = "I love Java"
    print(string.replace("Java","Python"))

    Output

    輸出量

    I love Python

    對準方法 (Alignment Methods)

    Alignment methods in python are used for positioning the text in particular place. The alignment methods used in python are given below.

    python中的對齊方法用于將文本放置在特定位置。 python中使用的對齊方法如下。

    🎲 center()

    🎲center()

    🎲 ljust()

    just ljust()

    🎲 rjust()

    🎲rjust()

    🎲 expandtabs()

    🎲expandtabs()

    🔖 center() Method

    🔖center()方法

    center() method is used to place the string in center to the width passed through it.

    center()方法用于將字符串放置在通過它的寬度中心。

    Syntax for center( ) methodcenter()方法的語法 string = "python"
    print(string.center(20))

    Output

    輸出量

    python
    ####################20 Spaces allocated in console(This line will not be printed)

    🔖 ljust() and rjust() Methods

    just ljust()和rjust()方法

    ljust() and rjust() methods are used to justify the string in a particular width to left and right ends respectively.

    ljust()和rjust()方法用于將字符串以特定寬度對齊到左右兩端。

    Syntax for ljust( ) methodljust()方法的語法 Syntax for rjust( ) methodrjust()方法的語法 string = "Python"
    print(string.ljust(10))
    print(string.rjust(10))

    Output

    輸出量

    Python
    Python

    🔖 expandtabs() Method

    🔖expandtabs()方法

    /t is a format specifier used to print a tab of space in string. This method expandtabs() helps to customise the length of tabs in a string.

    / t是一種格式說明符,用于打印字符串中的空格標簽。 此方法expandtabs()有助于自定義字符串中選項卡的長度。

    Syntax for expandtabs( ) methodexpandtabs()方法的語法 string = "Python\tProgramming"
    print(string)
    print(string.expandtabs(5))

    Output

    輸出量

    Python Programming
    Python Programming

    在Python中列出 (List in Python)

    In many situation we should collect more than one similar data. For example, if you need to create list of names of five persons, you have to create five variable names. When the count increases, that is very hard to find variable name for each entry. The list data type solves the problem. In a list you can store more than one data in which each entry can be accessed by single variable name. In this section we will discuss about the list data type and the methods used in list.

    在許多情況下,我們應該收集多個類似的數據。 例如,如果需要創建五個人的姓名列表,則必須創建五個變量名。 當計數增加時,很難為每個條目找到變量名。 列表數據類型解決了該問題。 在一個列表中,您可以存儲多個數據,其中每個條目都可以通過單個變量名進行訪問。 在本節中,我們將討論列表數據類型和列表中使用的方法。

    清單結構 (Structure of List)

    In a list all elements are separated by commas. A list can be created by inserting all elements inside square brackets. The elements inside a list can be of many types.

    在列表中,所有元素都用逗號分隔。 可以通過將所有元素插入方括號內來創建列表。 列表中的元素可以有多種類型。

    Structure of List清單結構

    用Python創建列表 (Creating List in Python)

    Let us create a list contains the following numbers as its elements.

    讓我們創建一個包含以下數字作為其元素的列表。

    148
    201
    958
    20199
    22036

    The list in Python,

    Python中的列表,

    my_list = [ 148, 201, 958, 20199, 22036]
    print(my_list)

    Output

    輸出量

    [148, 201, 958, 20199, 22036]

    在列表中建立索引 (Indexing in List)

    All elements in python are indexed as same as the string data type. Each element can be accessed by both positive and negative integers.

    python中所有元素的索引都與字符串數據類型相同。 每個元素都可以使用正整數和負整數進行訪問。

    Indexing in List在列表中建立索引

    訪問列表中的值 (Accessing Values in List)

    The index can be used to get the value from a list. Both positive and negative indexing can be used.

    索引可用于從列表中獲取值。 正索引和負索引都可以使用。

    my_list = [ 148, 201, 958, 20199, 22036]
    print(my_list[0])
    print(my_list[-5])
    print(my_list[2])
    print(my_list[-3])
    print(my_list[3])

    Output

    輸出量

    148
    148
    958
    958
    20199

    將值分配給列表元素 (Assigning Value to List Element)

    The value can be assigned to a list element using assignment operator (=).

    可以使用賦值運算符(=)將值賦給列表元素。

    列表中的方法 (Methods in List)

    We will discuss the following methods used to process a list object in python.

    我們將討論以下用于處理python中的列表對象的方法。

    🎲 append()

    🎲append()

    🎲 clear()

    🎲clear()

    🎲 copy()

    🎲copy()

    🎲 count()

    🎲count()

    🎲 extend()

    🎲extend()

    🎲 index()

    🎲index()

    🎲 insert()

    🎲insert()

    🎲 pop()

    🎲pop()

    🎲 remove()

    🎲remove()

    🎲 reverse()

    🎲reverse()

    🎲 sort()

    🎲sort()

    🔖 append( ) Method

    🔖append()方法

    append( ) Method is used to add item at the end of the list. We can add many items to the list continuously.

    append()方法用于在列表的末尾添加項目。 我們可以將許多項目連續添加到列表中。

    Syntax for append( ) methodappend()方法的語法 my_list = [1,2,3,4,5]
    my_list.append(6)
    print(my_list)

    Output

    輸出量

    [1, 2, 3, 4, 5, 6]

    🔖 clear( ) Method

    🔖clear()方法

    clear( ) method clears all the entry in a list. It will return an empty list after deleting all the elements.

    clear()方法清除列表中的所有條目。 刪除所有元素后,它將返回一個空列表。

    Syntax for clear( ) methodclear()方法的語法 my_list = [1,2,3,4,5]
    my_list.clear()
    print(my_list)

    Output

    輸出量

    []

    🔖 copy( ) Method

    🔖copy()方法

    copy( ) method is used to make a copy of existing list and store the list in another list variable.

    copy()方法用于復制現有列表并將該列表存儲在另一個列表變量中。

    Syntax for copy( ) methodcopy()方法的語法 my_list = [1,2,3,4,5]
    new_list = my_list.copy()
    print(new_list)

    Output

    輸出量

    [1, 2, 3, 4, 5]

    🔖 count( ) Method

    🔖count()方法

    count( ) method is used to count number of times a value get repeated in a list.

    count()方法用于計算一個值在列表中重復的次數。

    Syntax for count( ) methodcount()方法的語法 my_list = [1,5,1,2,3,1]
    print(my_list.count(1))

    Output

    輸出量

    3

    🔖 extend( ) Method

    🔖extend()方法

    extend( ) is used to add a collection item like list to an another list variable. The passed list is appended at the end of the previous list.

    extend()用于將諸如列表的收集項添加到另一個列表變量。 傳遞的列表將附加在上一個列表的末尾。

    Syntax for extend( ) methodextend()方法的語法 first_list = [1,2,3]
    second_list = ["Alex","Carter"]
    first_list.extend(second_list)
    print(first_list)

    Output

    輸出量

    [1, 2, 3, 'Alex', 'Carter']

    🔖 index( ) Method

    🔖index()方法

    index( ) method is used to get the index of a particular element. If you pass a element that is not present then python will through an exception.

    index()方法用于獲取特定元素的索引。 如果您傳遞的元素不存在,則python將通過異常。

    Syntax for index( ) methodindex()方法的語法 my_list = [3,4,2,1,5,4]
    print(my_list.index(4))

    Output

    輸出量

    1

    🔖 insert( ) Method

    🔖insert()方法

    insert( ) method is used to add an element at a particular index in a list.

    insert()方法用于在列表中的特定索引處添加元素。

    Syntax for insert( ) methodinsert()方法的語法 my_list = [1,2,4,5]
    my_list.insert(2,3)
    print(my_list)

    Output

    輸出量

    [1, 2, 3, 4, 5]

    🔖 pop( ) Method

    🔖pop()方法

    pop( ) method is used to delete an element in a particular index.

    pop()方法用于刪除特定索引中的元素。

    Syntax for pop( ) methodpop()方法的語法 my_list = [1,2,3,4,5]
    my_list.pop(2)
    print(my_list)

    Output

    輸出量

    [1, 2, 4, 5]

    🔖 remove( ) Method

    🔖remove()方法

    remove( ) is just like the pop( ) method but in this method the element is passed instead of index.

    remove()類似于pop()方法,但是在此方法中,元素是通過傳遞的,而不是索引。

    Syntax for remove( ) methodremove()方法的語法 my_list = [1,2,3,5,4]
    my_list.remove(3)
    print(my_list)

    Output

    輸出量

    [1, 2, 4, 5]

    🔖 reverse( ) Method

    🔖reverse()方法

    reverse( ) is used to reverse all the elements in a list. It doesn’t take any argument.

    reverse()用于反轉列表中的所有元素。 不需要任何爭論。

    Syntax for reverse( ) methodreverse()方法的語法 my_list = [1,2,3,4,5]
    my_list.reverse()
    print(my_list)

    Output

    輸出量

    [5, 4, 3, 2, 1]

    🔖 sort( ) Method

    🔖sort()方法

    sort() Method is used to sort all the elements in a list in ascending order.

    sort()方法用于按升序對列表中的所有元素進行排序。

    Syntax for sort( ) methodsort()方法的語法 my_list = [3,8,2,5,1]
    my_list.sort()
    print(my_list)

    Output

    輸出量

    [1, 2, 3, 5, 8]

    Python中的元組 (Tuple in Python)

    Tuple is a collection elements like list but which is immutable object. In tuple you cannot change the value. So item assignment is not possible in tuple. This section of article will help you to know the basics about tuple and their methods.

    元組是一個像list這樣的集合元素,但它是不可變的對象。 在元組中,您無法更改值。 因此,在元組中不可能進行項目分配。 本文的這一部分將幫助您了解有關元組及其方法的基礎知識。

    元組的結構 (The Structure of a Tuple)

    The tuple is created by separating each element by commas. The tuple elements are enclosed with parenthesis (). The items in the tuple can be in many kinds.

    通過用逗號分隔每個元素來創建元組。 元組元素用括號()括起來。 元組中的項可以有多種。

    Structure of Tuple元組的結構

    用Python創建元組 (Creating Tuple in Python)

    Let us create a tuple which contains the following data in a sequence.

    讓我們創建一個元組,它按順序包含以下數據。

    1
    Felix
    [97,95,99,100,94]
    (1,2,3)

    The tuple can have multiple data type in one collection.

    元組可以在一個集合中具有多種數據類型。

    my_tuple = [1,"Felix",[97,95,99,100,94],(1,2,3)]
    print(my_tuple)

    Output

    輸出量

    [1, 'Felix', [97, 95, 99, 100, 94], (1, 2, 3)]

    元組索引 (Indexing in Tuple)

    Each element in the tuple are indexed with integers. Any item in a tuple can be accessed by positive or negative index.

    元組中的每個元素都用整數索引。 元組中的任何項都可以通過正或負索引訪問。

    Indexing of Tuple elements元組元素的索引

    訪問元組中的值 (Accessing Values in Tuple)

    The tuple items can be accessed with help of the index of the item.

    可以在項目索引的幫助下訪問元組項目。

    my_tuple = [1,"Felix",[97,95,99,100,94],(1,2,3)]print(2)

    Output

    輸出量

    [97,95,99,100,94]

    元組中的方法 (Methods in Tuple)

    There are two major methods available in tuple.

    元組中有兩種主要方法。

    🎲 count()

    🎲count()

    🎲 index()

    🎲index()

    🔖 count( ) Method

    🔖count()方法

    count() method is used to count how many times a particular item occurred in a tuple().

    count()方法用于計算特定項目在tuple()中發生了多少次。

    Syntax for count( ) methodcount()方法的語法 my_tuple = (1,2,3,1,5,6,1)
    print(my_tuple.count(1))

    Output

    輸出量

    3

    🔖 index( ) Method

    🔖index()方法

    index( ) method is used to get the index of a item at which it occurs for first time.

    index()方法用于獲取第一次出現的項目的索引。

    Syntax for index( ) methodindex()方法的語法 my_tuple = (2,3,4,1,8,3)
    print(my_tuple.index(3))

    Output

    輸出量

    1

    在Python中設置 (Set in Python)

    Set is a unordered collection of unique elements in Python. It is also a basic data type in Python. It gives us the flexibility to work with the mathematical concepts like set theory.

    Set是Python中唯一元素的無序集合。 它也是Python中的基本數據類型。 它使我們可以靈活地處理諸如集合論之類的數學概念。

    集的結構 (Structure of Set)

    Set is a collection of elements separated by commas. The set elements are enclosed with curly braces. All elements in the set are unique values.

    Set是由逗號分隔的元素的集合。 set元素用花括號括起來。 集合中的所有元素都是唯一值。

    Set

    創作集 (Creation of Set)

    A set can be created using assignment operator. It is same as the creation of list in Python.

    可以使用賦值運算符來創建集合。 它與在Python中創建列表相同。

    my_set = {6,7,3,2,1,8,9,1}
    print(my_set)

    Output

    輸出量

    {1, 2, 3, 6, 7, 8, 9}

    1 is printed only one time. This show that all values must be unique.

    1只打印一次。 這表明所有值都必須是唯一的。

    集合中的方法 (Methods in Set)

    Here is the list of methods used mostly in set.

    這是主要用于set中的方法列表。

    🎲 add()

    🎲add()

    🎲 clear()

    🎲clear()

    🎲 difference()

    🎲差異()

    🎲 discard()

    🎲丟棄()

    🎲 intersection()

    🎲交集()

    🎲 pop()

    🎲pop()

    🎲 remove()

    🎲remove()

    🎲 symmetric_difference()

    🎲symmetric_difference()

    🔖 add() Method

    🔖add()方法

    add() method is used to add elements to set.

    add()方法用于添加要設置的元素。

    Syntax for add( ) methodadd()方法的語法 my_set = {1,2,3,4}
    my_set.add(5)
    print(my_set)

    Output

    輸出量

    {1, 2, 3, 4, 5}

    🔖 clear() Method

    🔖clear()方法

    This method clears all the elements present in a set.

    此方法清除集中存在的所有元素。

    Syntax for clear( ) methodclear()方法的語法 my_set = {1,2,3,4}
    my_set.clear()
    print(my_set)

    Output

    輸出量

    set()

    🔖 difference() Method

    🔖difference()方法

    This method returns a new set contains the elements that present in a set but not in the other.

    此方法返回一個新集合,其中包含存在于一個集合中但不存在于另一個集合中的元素。

    Syntax for difference( ) methodDifference()方法的語法 my_set = {1,2,3,4}
    new_set= {1,6,7,3,9}
    diff_set=my_set.difference(new_set)
    print(diff_set)

    Output

    輸出量

    {2, 4}

    🔖 discard() Method

    🔖throws()方法

    discard() method is used to remove an item from the set.

    reject()方法用于從集合中刪除一個項目。

    Syntax for discard( ) methodthrows()方法的語法 my_set = {1,2,3,4}
    my_set.discard(3)
    print(my_set)

    Output

    輸出量

    {1, 2, 4}

    🔖 intersection() Method

    🔖交集()方法

    intersection() method is used to create a new set with common elements in all sets.

    交集()方法用于創建一個在所有集合中具有共同元素的新集合。

    Syntax for intersection( ) method相交()方法的語法 my_set = {1,2,3,4}
    new_set = {1,5,2,7}
    inter_set=my_set.intersection(new_set)
    print(inter_set)

    Output

    輸出量

    {1, 2}

    🔖 pop() and remove() methods

    🔖pop()和remove()方法

    pop() and remove() methods are used to remove an element from the set. pop() removes an arbitrary element whereas remove() removes the specified element.

    pop()和remove()方法用于從集合中刪除元素。 pop()刪除任意元素,而remove()刪除指定元素。

    Syntax for pop( ) methodpop()方法的語法 Syntax for remove( ) methodremove()方法的語法 my_set = {1,2,3,4}
    my_set.pop()
    print(my_set)

    Output

    輸出量

    {2, 3, 4}

    Program for remove method

    刪除方法程序

    my_set = {1,2,3,4}
    my_set.remove(2)
    print(my_set)

    Output

    輸出量

    {1, 3, 4}

    Python字典 (Dictionary in Python)

    Welcome to my favorite data type in Python. Dictionary is a most interesting and useful data type in Python. To understand the concept of Dictionary, we may consider the contact list in our phone. Each contact is stored using a pair of name and contact number.

    歡迎使用Python中我最喜歡的數據類型。 字典是Python中最有趣,最有用的數據類型。 要了解字典的概念,我們可以考慮手機中的聯系人列表。 每個聯系人都使用一對姓名和聯系號碼進行存儲。

    The reason for using this method is the hardness of remembering lot of numbers in your brain. But, you can remember the names easily. When you need to make a call you can refer the contact list with help of the name in the list and it will be enough to access the phone number too. The Dictionary data type works in the same way.

    使用這種方法的原因是很難記住大腦中的許多數字。 但是,您可以輕松記住這些名稱。 當您需要撥打電話時,可以借助列表中的姓名參考聯系人列表,這也足以訪問電話號碼。 詞典數據類型以相同的方式工作。

    Photo by Waldemar Brandt on Unsplash Waldemar Brandt在Unsplash上拍攝的照片

    Dictionary contains two set of value associated with each other. One is called key and another one is called value. The both combined together is called key-value pair or dictionary.

    字典包含兩組彼此關聯的值。 一個叫做鍵,另一個叫做值。 兩者結合在一起稱為鍵值對或字典。

    Each element in dictionary will be in the following form.

    字典中的每個元素將采用以下形式。

    Key Value Pair關鍵值對

    字典的結構 (The Structure of a Dictionary)

    A Dictionary will have one or more key value pairs separated by commas. The dictionary is created using the curly braces {} . The key and value in each element of dictionary is separated by colon : . Each key in a dictionary must be unique one.

    詞典將具有一個或多個用逗號分隔的鍵值對。 使用花括號{}創建字典。 字典中每個元素的鍵和值用冒號分隔:。 詞典中的每個鍵都必須是唯一的。

    Dictionary Structure字典結構

    用Python創建字典 (Creating Dictionary in Python)

    Let use create a dictionary contains a contact list of three persons. The contact list given here.

    讓我們使用創建包含三個人的聯系人列表的字典。 此處給出的聯系人列表。

    Alex - 783 456 2763
    Clan - 462 355 3728
    Olivia - 688 323 2237

    The equivalent form of dictionary for this data set is created in Python below.

    下面在Python中創建了與此數據集對應的字典形式。

    contact = {"Alex":"7834562763", "Clan":"4623553728", "Olivia":"6883232237"}

    字典無序 (Dictionary is Unordered)

    Dictionary is not like list, we can’t access the key value pair using any index. If two dictionaries have same contents in different order, then both are same dictionaries.

    字典與列表不同,我們無法使用任何索引訪問鍵值對。 如果兩個字典的內容以不同的順序排列,則它們都是相同的字典。

    Let us create another dictionary for the same contact list.

    讓我們為相同的聯系人列表創建另一個詞典。

    contact2 = {"Clan":"4623553728", Olivia:"6883232237", Alex:"7834562763"}

    We can check whether two dictionaries are same or not using if statement.

    我們可以使用if語句檢查兩個字典是否相同。

    if(contact==contact2):
    print("Same Dictionary")
    else:
    print("Not Same Dictionary")

    Output

    輸出量

    Same Dictionary

    So order of the key-value pair is not important in dictionary. Because all the values are accessed using the key of the dictionary.

    So order of the key-value pair is not important in dictionary. Because all the values are accessed using the key of the dictionary.

    Accessing a Value in Dictionary (Accessing a Value in Dictionary)

    As I mentioned earlier, a value in a dictionary can be accessed with the help of key value.

    As I mentioned earlier, a value in a dictionary can be accessed with the help of key value.

    Syntax for accessing a value is,

    Syntax for accessing a value is,

    Let us try to access a contact number of Alex in the contact list created in previous program.

    Let us try to access a contact number of Alex in the contact list created in previous program.

    contact = {"Alex":"7834562763", "Clan":"4623553728", "Olivia":"6883232237"}
    print(contact["Alex"])

    Output

    輸出量

    7834562763

    Assigning Value to Key (Assigning Value to Key)

    The value can be assigned to a key using assignment operator (=). It works in two different cases. Let us take a look at the syntax for assigning value to the key in dictionary.

    The value can be assigned to a key using assignment operator (=). It works in two different cases. Let us take a look at the syntax for assigning value to the key in dictionary.

    Case 1:

    情況1:

    When you try to assign a value for a key that already exists in dictionary, the value will get updated. For example, I will try to change the phone number of Alex in the contact list.

    When you try to assign a value for a key that already exists in dictionary, the value will get updated. For example, I will try to change the phone number of Alex in the contact list.

    contact = {"Alex":"7834562763", "Clan":"4623553728", "Olivia":"6883232237"}contact["Alex"] = "1234567890"print(contact["Alex"])

    Output

    輸出量

    1234567890

    It shows that the previous value get updated.

    It shows that the previous value get updated.

    Case 2:

    情況2:

    If you try to assign a value to a key which is not present in the dictionary already, then a new key-value pair will be added to the dictionary. In the following code I am going to assign a phone number value to key name called “Ella”.

    If you try to assign a value to a key which is not present in the dictionary already, then a new key-value pair will be added to the dictionary. In the following code I am going to assign a phone number value to key name called “Ella”.

    contact = {"Alex":"7834562763", "Clan":"4623553728", "Olivia":"6883232237"}contact["Ella"]="4531323768"
    print(contact)

    Output

    輸出量

    {'Alex': '7834562763', 'Olivia': '6883232237', 'Ella': '4531323768', 'Clan': '4623553728'}

    New key value pair is added to the contact dictionary.

    New key value pair is added to the contact dictionary.

    Methods in Dictionary (Methods in Dictionary)

    The methods used for processing the dictionary data type is given below.

    The methods used for processing the dictionary data type is given below.

    🎲 get()

    🎲 get()

    🎲 keys()

    🎲 keys()

    🎲 values()

    🎲 values()

    🎲 update()

    🎲 update()

    🎲 pop()

    🎲 pop()

    🎲 popitem()

    🎲 popitem()

    🎲 clear()

    🎲 clear()

    🎲 items()

    🎲 items()

    🎲 del()

    🎲 del()

    Let us discuss each methods in dictionary using some examples.

    Let us discuss each methods in dictionary using some examples.

    🔖 get( ) Method

    🔖 get( ) Method

    get( ) method is an another way to access the value associated with a key in dictionary. It take the key value as its argument.

    get( ) method is an another way to access the value associated with a key in dictionary. It take the key value as its argument.

    Syntax for get( ) MethodSyntax for get( ) Method contact = {"Alex":"7834562763", "Clan":"4623553728", "Olivia":"6883232237"}print(contact.get("Alex"))

    Output

    輸出量

    7834562763

    If you try to access a key which is not present in the dictionary, then it will return None. So there will not be an exception for this.

    If you try to access a key which is not present in the dictionary, then it will return None. So there will not be an exception for this.

    contact = {"Alex":"7834562763", "Clan":"4623553728", "Olivia":"6883232237"}print(contact.get("Carter"))

    Output

    輸出量

    None

    🔖 keys( ) Method and values( ) Method

    🔖 keys( ) Method and values( ) Method

    keys( ) method is used to list out all the keys present in a dictionary and values( ) method is used to list the values present in the dictionary.

    keys( ) method is used to list out all the keys present in a dictionary and values( ) method is used to list the values present in the dictionary.

    Syntax for keys( ) methodSyntax for keys( ) method Syntax for values( ) methodSyntax for values( ) method contact = {"Alex":"7834562763", "Clan":"4623553728", "Olivia":"6883232237"}print(contact.keys())
    print(contact.values())

    Output

    輸出量

    dict_keys(['Alex', 'Olivia', 'Clan'])
    dict_values(['7834562763', '6883232237', '4623553728'])

    🔖 update( ) Method

    🔖 update( ) Method

    update( ) method works as cases explained in value assignment section in dictionary. Here, a dictionary is given as an argument then each key value will be checked. If any key is already present in the dictionary then the value will get updated. If not new key value pair is added to the dictionary.

    update( ) method works as cases explained in value assignment section in dictionary. Here, a dictionary is given as an argument then each key value will be checked. If any key is already present in the dictionary then the value will get updated. If not new key value pair is added to the dictionary.

    Syntax for update( ) methodSyntax for update( ) method contact = {"Alex":"7834562763", "Clan":"4623553728", "Olivia":"6883232237"}contact2 = {"Alex":"1234567890","Carter":"6583426552"}contact.update(contact2)print(contact)

    Output

    輸出量

    {'Olivia': '6883232237', 'Clan': '4623553728', 'Carter': '6583426552', 'Alex': '1234567890'}

    🔖 pop( ) Method

    🔖 pop( ) Method

    pop( ) method is used for deleting a key value pair by passing the key to it. If the passed key is not present in the dictionary then it will raise an keyerror exception.

    pop( ) method is used for deleting a key value pair by passing the key to it. If the passed key is not present in the dictionary then it will raise an keyerror exception.

    Syntax for pop( ) methodSyntax for pop( ) method contact = {"Alex":"7834562763", "Clan":"4623553728", "Olivia":"6883232237"}contact.pop("Alex")print(contact)

    Output

    輸出量

    {'Clan': '4623553728', 'Olivia': '6883232237'}

    🔖 popitem( ) Method

    🔖 popitem( ) Method

    popitem() removes the key value pair that added lastly to the dictionary. This popitem() method does not take any argument.

    popitem() removes the key value pair that added lastly to the dictionary. This popitem() method does not take any argument.

    Syntax for popitem( ) methodSyntax for popitem( ) method contact = {"Alex":"7834562763", "Clan":"4623553728", "Olivia":"6883232237"}contact.popitem()print(contact)

    Output

    輸出量

    {'Olivia': '6883232237', 'Clan': '4623553728'}

    🔖 clear( ) Method

    🔖 clear( ) Method

    clear() method removes all the key value pairs in a dictionary and returns an empty dictionary.

    clear() method removes all the key value pairs in a dictionary and returns an empty dictionary.

    Syntax for clear( ) methodSyntax for clear( ) method contact = {"Alex":"7834562763", "Clan":"4623553728", "Olivia":"6883232237"}contact.clear()print(contact)

    Output

    輸出量

    {}

    🔖 items( ) Method

    🔖 items( ) Method

    items( ) method returns all the key value pairs as a tuple inside a list.

    items( ) method returns all the key value pairs as a tuple inside a list.

    Syntax for items( ) methodSyntax for items( ) method contact = {"Alex":"7834562763", "Clan":"4623553728", "Olivia":"6883232237"}print(contact.items())

    Output

    輸出量

    dict_items([('Clan', '4623553728'), ('Olivia', '6883232237'), ('Alex', '7834562763')])

    🔖 del ( ) Method

    🔖 del ( ) Method

    del( ) method deletes the entire dictionary. It you try to access a deleted dictionary you will end up with some errors. clear( ) method is like deleting all contacts in your app whereas del( ) is uninstalling the contact app from your mobile phone.

    del( ) method deletes the entire dictionary. It you try to access a deleted dictionary you will end up with some errors. clear( ) method is like deleting all contacts in your app whereas del( ) is uninstalling the contact app from your mobile phone.

    Syntax for del( ) MethodSyntax for del( ) Method contact = {"Alex":"7834562763", "Clan":"4623553728", "Olivia":"6883232237"}del(contact)print(contact)

    Output

    輸出量

    NameError: name 'contact' is not defined

    Python中的函數 (Functions in Python)

    Breaking down your program into multiple parts gives us great flexibility over the code. The concept of functional programming enables a programmer to write better programs with higher simplicity. Even though python is object-oriented in nature the implementation of function concepts in python is very simple. This article will help you to understand the basics of function creation and some advanced functional programming concepts.

    Breaking down your program into multiple parts gives us great flexibility over the code. The concept of functional programming enables a programmer to write better programs with higher simplicity. Even though python is object-oriented in nature the implementation of function concepts in python is very simple. This article will help you to understand the basics of function creation and some advanced functional programming concepts.

    什么是功能? (What is a function?)

    A function is a small piece of code that does something in the program with or without getting input parameters. Function usually prints the output or returns a value to the place from where the function is called. Still confusing? Let me try to simplify the concept of functions using a scenario. Imagine you are going to buy a birthday cake for your friend. Who will you approach to make a cake? A doctor or a baker? That will be a baker. Because a baker is someone who can prepare a cake for you. It doesn’t mean a doctor cannot bake a cake. Instead of one person doing all kinds of work, we can categorize people into multiple professions. Here each professional has its unique type of services by getting unique types of requirements from the consumer.

    A function is a small piece of code that does something in the program with or without getting input parameters. Function usually prints the output or returns a value to the place from where the function is called. Still confusing? Let me try to simplify the concept of functions using a scenario. Imagine you are going to buy a birthday cake for your friend. Who will you approach to make a cake? A doctor or a baker? That will be a baker. Because a baker is someone who can prepare a cake for you. It doesn't mean a doctor cannot bake a cake. Instead of one person doing all kinds of work, we can categorize people into multiple professions. Here each professional has its unique type of services by getting unique types of requirements from the consumer.

    The function works in the same manner. A function is a unique code snippet created by the developer to use wherever he needs the same kind of operations. Look at the following code sample without any function definition.

    The function works in the same manner. A function is a unique code snippet created by the developer to use wherever he needs the same kind of operations. Look at the following code sample without any function definition.

    name_1 = input("Your Name Here:")
    year_of_birth_1 = int(input())name_2 = input("Your Name Here:")
    year_of_birth_2 = int(input())name_3 = input("Your Name Here:")
    year_of_birth_3 = int(input())print("Check",name_1,"'s YOB is Leap or Not:")
    if(year_of_birth_1%4==0):
    if(year_of_birth_1%100==0):
    if(year_of_birth_1%400==0):
    print("Leap Year")
    else:
    print("Not Leap Year")
    else:
    print("Leap Year")
    else:
    print("Not Leap Year")print("Check",name_2,"'s YOB is Leap or Not:")
    if(year_of_birth_2%4==0):
    if(year_of_birth_2%100==0):
    if(year_of_birth_2%400==0):
    print("Leap Year")
    else:
    print("Not Leap Year")
    else:
    print("Leap Year")
    else:
    print("Not Leap Year")print("Check",name_3,"'s YOB is Leap or Not:")
    if(year_of_birth_3%4==0):
    if(year_of_birth_3%100==0):
    if(year_of_birth_3%400==0):
    print("Leap Year")
    else:
    print("Not Leap Year")
    else:
    print("Leap Year")
    else:
    print("Not Leap Year")

    The output of the above program is given below.

    The output of the above program is given below.

    Your Name Here:Felix
    2000
    Your Name Here:Antony
    1998
    Your Name Here:Alex
    2004
    Check Felix 's YOB is Leap or Not:
    Leap Year
    Check Antony 's YOB is Leap or Not:
    Not Leap Year
    Check Alex 's YOB is Leap or Not:
    Leap Year

    In the above program, the same operations are performed in three different places. Imagine this kind of program in which the same kind of operations is conducted many times. The final code will be a complex one. Now take a look at the following program in which a function called check_leap is created used wherever required.

    In the above program, the same operations are performed in three different places. Imagine this kind of program in which the same kind of operations is conducted many times. The final code will be a complex one. Now take a look at the following program in which a function called check_leap is created used wherever required.

    def check_leap(YOB):
    if(year_of_birth_3%4==0):
    if(year_of_birth_3%100==0):
    if(year_of_birth_3%400==0):
    print("Leap Year")
    else:
    print("Not Leap Year")
    else:
    print("Leap Year")
    else:
    print("Not Leap Year")name_1 = input("Your Name Here:")
    year_of_birth_1 = int(input())name_2 = input("Your Name Here:")
    year_of_birth_2 = int(input())name_3 = input("Your Name Here:")
    year_of_birth_3 = int(input())print("Check",name_1,"'s YOB is Leap or Not:")
    check_leap(year_of_birth_1)print("Check",name_2,"'s YOB is Leap or Not:")
    check_leap(year_of_birth_2)print("Check",name_3,"'s YOB is Leap or Not:")
    check_leap(year_of_birth_3)

    It gives the same output as the previous program but it is really easy to understand. The statements required for checking leap year is written only one time in the program. That is why functional programming gives us easy debugging chances.

    It gives the same output as the previous program but it is really easy to understand. The statements required for checking leap year is written only one time in the program. That is why functional programming gives us easy debugging chances.

    Your Name Here:Felix
    2000
    Your Name Here:Antony
    1998
    Your Name Here:Alex
    2004
    Check Felix 's YOB is Leap or Not:
    Leap Year
    Check Antony 's YOB is Leap or Not:
    Not Leap Year
    Check Alex 's YOB is Leap or Not:
    Leap Year

    Classification of Functions (Classification of Functions)

    I hope you have understood the basic need for functions in programming. In python, we can further classify the functions into two different types. They are user-defined functions and in built functions. The in built functions are functions that are readily available to be called in the program. In the definition before the first program, I have mentioned that I am going to write a program without function definition not without function. Yes! We have already used some functions in that program too. The functions inputand printare some examples of in built functions. These in built functions are created by the developers of the language with some inner engineering like the check_leapfunction. This check_leap is an example of user-defined functions that are created by the programmer as per the requirement.

    I hope you have understood the basic need for functions in programming. In python, we can further classify the functions into two different types. They are user-defined functions and in built functions. The in built functions are functions that are readily available to be called in the program. In the definition before the first program, I have mentioned that I am going to write a program without function definition not without function. 是! We have already used some functions in that program too. The functions input and print are some examples of in built functions. These in built functions are created by the developers of the language with some inner engineering like the check_leap function. This check_leap is an example of user-defined functions that are created by the programmer as per the requirement.

    Definition and Call of a function (Definition and Call of a function)

    The instructions written under the check_leap function are called function definition. This defined instructions will be executed whenever a function is called from a particular place.

    The instructions written under the check_leap function are called function definition. This defined instructions will be executed whenever a function is called from a particular place.

    The check_leap function with a value passed through it is called a function call. The function can be called with or without any value. The value passed through the function is called parameter or arguments. Based on the arguments passed and return value the user-defined function can be classified into four groups.

    The check_leap function with a value passed through it is called a function call. The function can be called with or without any value. The value passed through the function is called parameter or arguments. Based on the arguments passed and return value the user-defined function can be classified into four groups.

    • Function without Argument and without Return Value

      Function without Argument and without Return Value

    • Function without Argument and with Return Value

      Function without Argument and with Return Value

    • Function with Argument and without Return Value

      Function with Argument and without Return Value

    • Function with Argument and with Return Value

      Function with Argument and with Return Value

    Function without argument and without return value (Function without argument and without return value)

    The value returned by the function is called the return value. We can return a value from a user-defined function by using a keyword called return. Some functions don’t require any arguments to be passed and return nothing. These kinds of functions fall under this category. The following program is an example of a function without argument and the return value.

    The value returned by the function is called the return value. We can return a value from a user-defined function by using a keyword called return . Some functions don't require any arguments to be passed and return nothing. These kinds of functions fall under this category. The following program is an example of a function without argument and the return value.

    def eligible():
    print("You are Eligible to take the Exam")def not_eligible():
    print("You are not Eligible to take the Exam")age = int(input("Enter Your Age:"))if(age<20):
    not_eligible()
    elif(age>=20 and age<35):
    eligible()
    else:
    not_eligible()

    Output

    輸出量

    Enter Your Age:24
    You are Eligible to take the Exam

    In the above program, there are two user-defined functions are created. In the function definition, you can see that there is no argument is defined inside the function. So we don’t need any parameters to call these functions.

    In the above program, there are two user-defined functions are created. In the function definition, you can see that there is no argument is defined inside the function. So we don't need any parameters to call these functions.

    Function without argument and with return value (Function without argument and with return value)

    In some cases, a function will return a value without taking any argument or parameter. These types of functions are the functions without argument and with a return value. Look at the following example program for understanding the concept better.

    In some cases, a function will return a value without taking any argument or parameter. These types of functions are the functions without argument and with a return value. Look at the following example program for understanding the concept better.

    def low_dosage():
    return 75
    def med_dosage():
    return 100
    def high_dosage():
    return 150age = int(input("Patient's Age:"))
    temp = float(input("Body Temperature:"))if(age<10 and temp>98 and temp<99):
    print("The medicine with ",low_dosage(),"mgs is enough.")
    elif(age<10 and temp>99):
    print("The medicine with",med_dosage(),"mgs is enough.")
    elif(age>10 and temp>98 and temp<99):
    print("The medicine with",med_dosage(),"mgs is enough.")
    elif(age>10 and temp>99):
    print("The medicine with",high_dosage(),"mgs is enough.")

    Output

    輸出量

    Patient's Age:35
    Body Temperature:100
    The medicine with 150 mgs is enough.

    The called functions are highlighted in the program. Whenever a function returns a value using the keyword return the value can be stored in a variable or formatted using the print function.

    The called functions are highlighted in the program. Whenever a function returns a value using the keyword return the value can be stored in a variable or formatted using the print function.

    Function with arguments and without return value (Function with arguments and without return value)

    Some functions will take some parameters to it and does not return any value back. The following code will help you to understand the concept.

    Some functions will take some parameters to it and does not return any value back. The following code will help you to understand the concept.

    def low(amount,year):
    rate = 6.5
    interest = amount * year * rate/100
    if(year<5):
    print("Your interest will be",interest * 1.2)
    else:
    print("Your interest will be",interest * 1.4)
    def high(amount,year):
    rate = 8.5
    interest = amount * year * rate/100
    if(year<5):
    print("Your interest will be",interest * 1.2)
    else:
    print("Your interest will be",interest * 1.4)amount = int(input("Investment Amount:"))
    year = int(input("No of Years:"))if(amount<100000):
    low(amount,year)
    else:
    high(amount,year)

    Output

    輸出量

    Investment Amount:120000
    No of Years:6
    Your interest will be 85680.0

    The two functions low and high both functions getting two values as their arguments and it returns nothing. Simply we can say that the output is formatted in the function itself. But that is not true always. We can create a function for doing nothing.

    The two functions low and high both functions getting two values as their arguments and it returns nothing. Simply we can say that the output is formatted in the function itself. But that is not true always. We can create a function for doing nothing.

    Function with arguments and with return value (Function with arguments and with return value)

    This type of user-defined function is the majorly used in many situations. It takes some arguments into it and returns some values to the function call. Let us try to rewrite the previous program for this type of user-defined function.

    This type of user-defined function is the majorly used in many situations. It takes some arguments into it and returns some values to the function call. Let us try to rewrite the previous program for this type of user-defined function.

    def low(amount,year):
    rate = 6.5
    interest = amount * year * rate/100
    if(year<5):
    return interest*1.2
    else:
    return interest*1.4
    def high(amount,year):
    rate = 8.5
    interest = amount * year * rate/100
    if(year<5):
    return interest*1.2
    else:
    return interest*1.4amount = int(input("Investment Amount:"))
    year = int(input("No of Years:"))if(amount<100000):
    print("Your Interest will be",low(amount,year))
    else:
    print("Your Interest will be",high(amount,year))

    Output

    輸出量

    Investment Amount:98000
    No of Years:4
    Your Interest will be 30576.0

    Instead of printing the value inside the function, the return keyword returns the interest value to the place from which the value is called. The function call is highlighted with bold letters.

    Instead of printing the value inside the function, the return keyword returns the interest value to the place from which the value is called. The function call is highlighted with bold letters.

    Here I have written a program which contains all the four types of functions in it. Try to understand each type and usage of that in a particular place.

    Here I have written a program which contains all the four types of functions in it. Try to understand each type and usage of that in a particular place.

    def question():
    print("Your Name:")
    def type():
    print("Type of Account")
    def savings():
    return 1.8
    def fixed():
    return 2.3
    def interest_calc(amount,year,rate):
    interest_amt=amount * year * rate/100
    return interest_amt
    def total_calc(amount,interest):
    return amount+interest
    def info(name,total,year):
    print(name,"'s Total amount after",year,"is",total)question()
    name = input()
    type()
    t=int(input("Savings(1)/Fixed(2)"))
    if(t==1):
    rate = savings()
    elif(t==2):
    rate = fixed()
    amount = int(input("Amount:"))
    year = int(input("Year:"))
    interest = interest_calc(amount,year,rate)
    total = total_calc(amount,interest)
    info(name,total,year)

    Output

    輸出量

    Your Name:
    Felix
    Type of Account
    Savings(1)/Fixed(2)1
    Amount:18000
    Year:5
    Felix 's Total amount after 5 is 19620.0

    Scope of Variable (Scope of Variable)

    Every variable defined in the program has its own scope. That is there will be a range in which we can access the value with a particular variable name. Usually, a variable can accessible within the function only. Let me demonstrate the scope of a variable using the following program.

    Every variable defined in the program has its own scope. That is there will be a range in which we can access the value with a particular variable name. Usually, a variable can accessible within the function only. Let me demonstrate the scope of a variable using the following program.

    def info():
    value = 5
    print("The value is",value)
    def test():
    print("The value is",value)info()
    test()

    Output

    輸出量

    The value is 5
    Traceback (most recent call last):
    File "main.py", line 7, in <module>
    test()
    File "main.py", line 5, in test
    print("The value is",value)
    NameError: name 'value' is not defined

    You get some exceptions over the program. This is because the scope of the variable value is constrained between the range of function info(). So that it cannot be accessible by other functions.

    You get some exceptions over the program. This is because the scope of the variable value is constrained between the range of function info() . So that it cannot be accessible by other functions.

    Global Variables in Python (Global Variables in Python)

    Global variables are variables that can be accessed anywhere in the program. Usually, the variables defined in the main function are global variables. We don’t need any extra syntax to make global variables. But if we need to create a global variable inside any function we can use the keyword called global.

    Global variables are variables that can be accessed anywhere in the program. Usually, the variables defined in the main function are global variables. We don't need any extra syntax to make global variables. But if we need to create a global variable inside any function we can use the keyword called global .

    Syntax: global variable_name

    Syntax: global variable_name

    Here I modified the previous program with the keyword global .

    Here I modified the previous program with the keyword global .

    def info():
    global value
    value = 5
    print("The value is",value)
    def test():
    print("The value is",value)info()
    test()

    *args and **kwargs in Python (*args and **kwargs in Python)

    In previous programs, we exactly know how many parameters are going into a function. But what if we don’t know the number of arguments in advance. Here is how the list arguments and keyword arguments come to play. These are some methods to pass a collection of values with only one name. Look at the following example for *args method.

    In previous programs, we exactly know how many parameters are going into a function. But what if we don't know the number of arguments in advance. Here is how the list arguments and keyword arguments come to play. These are some methods to pass a collection of values with only one name. Look at the following example for *args method.

    def function(*args):
    for x in args:
    print(x)function("Felix","Antony")

    Output

    輸出量

    Felix
    Antony

    The function takes more than one value at a time in the format of a tuple. The tuple can be accessed by the index with args as tuple name. Here is another example that contains more than one argument.

    The function takes more than one value at a time in the format of a tuple. The tuple can be accessed by the index with args as tuple name. Here is another example that contains more than one argument.

    def function(name ,*args):
    print(name)
    for x in args:
    print(x)function("Felix Antony", "Medium", "Writer")

    Output

    輸出量

    Felix Antony
    Medium
    Writer

    Here the first preference is given to the single arguments. Usually, we have to keep *args and **kwargs in the last place in the arguments list.

    Here the first preference is given to the single arguments. Usually, we have to keep *args and **kwargs in the last place in the arguments list.

    The **kwargs also working same as the previous one. But instead of a tuple, we are using dictionary data type here. The dictionary value can be accessed by its key values. That is why it is called as keyword arguments.

    The **kwargs also working same as the previous one. But instead of a tuple, we are using dictionary data type here. The dictionary value can be accessed by its key values. That is why it is called as keyword arguments.

    def myfunction(**kwargs):
    for x,y in kwargs.items():
    print(y)myfunction(First_name = "Felix", Last_name = "Antony")

    Output

    輸出量

    Antony
    Felix

    *args and **kwargs are the common convention. We can choose our own name for implementing these arguments. But keeping the common name will be a better option.

    *args and **kwargs are the common convention. We can choose our own name for implementing these arguments. But keeping the common name will be a better option.

    Lambda表達式 (Lambda Expressions)

    Lambda is a pure anonymous function in python which allows us to write a function in a single line of code. It reduces the effort of programmer in writing multiple lines of code to create user-defined functions. Before going to write the actual code we must understand the concept behind the lambda function. Look at the explanation about lambda in Wikipedia.

    Lambda is a pure anonymous function in python which allows us to write a function in a single line of code. It reduces the effort of programmer in writing multiple lines of code to create user-defined functions. Before going to write the actual code we must understand the concept behind the lambda function. Look at the explanation about lambda in Wikipedia .

    Lambda calculus (also written as λ-calculus) is a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution. It is a universal model of computation that can be used to simulate any Turing machine.

    Lambda calculus (also written as λ- calculus ) is a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution. It is a universal model of computation that can be used to simulate any Turing machine.

    Lambda Function Symbol

    Lambda Function Symbol

    Lambda calculus was introduced by the mathematician Alonzo Church to investigate the foundational mathematical calculus. This calculus helps the mathematicians to understand the mechanism between basic arithmetic and logical operations. The symbolic representation of the lambda is λ Greek alphabet.

    Lambda calculus was introduced by the mathematician Alonzo Church to investigate the foundational mathematical calculus. This calculus helps the mathematicians to understand the mechanism between basic arithmetic and logical operations. The symbolic representation of the lambda is λ Greek alphabet.

    In python, the function is denoted with the keyword lambda . Look at the syntax of the lambda function.

    In python, the function is denoted with the keyword lambda . Look at the syntax of the lambda function.

    Syntax: lambda arguments : expression

    Syntax: lambda arguments : expression

    Let us create a function to calculate the volume of given cube.

    Let us create a function to calculate the volume of given cube.

    def volume(side):
    return side*side*sideside = int(input("Enter Side of Cube"))
    Volume_of_cube = volume(side)
    print( Volume_of_cube )

    Look at the following code which contains lambda expression to create the function.

    Look at the following code which contains lambda expression to create the function.

    side = int(input("Enter Side of Cube"))
    Volume_of_cube = lambda side : side * side * sideprint( Volume_of_cube (side) )

    Both codes give the same output for similar kind of inputs as follows.

    Both codes give the same output for similar kind of inputs as follows.

    Enter Side of Cube6
    216

    Why Anonymous? (Why Anonymous?)

    In the previous program, we have called the lambda function with the help of the name Volume_of_cube . But actually this name is not a function name. The previous program is just one of the ways to use a lambda function. In python the function created using the lambda does not have any function name. In the program, the variable name itself acted as function name. To understand clearly you can replace the entire lambda expression instead of the variable name.

    In the previous program, we have called the lambda function with the help of the name Volume_of_cube . But actually this name is not a function name. The previous program is just one of the ways to use a lambda function. In python the function created using the lambda does not have any function name. In the program, the variable name itself acted as function name. To understand clearly you can replace the entire lambda expression instead of the variable name.

    side = int(input("Enter Side of Cube"))
    print( (lambda side : side * side * side) (side) )

    I hope you can understand the concept. That is why the lambda expression is called as an anonymous function. There are certain conditions in creating a lambda function in Python. More than one argument can be passed in the lambda expression but only one expression can be created in it. Some more examples are given below using lambda functions.

    I hope you can understand the concept. That is why the lambda expression is called as an anonymous function. There are certain conditions in creating a lambda function in Python. More than one argument can be passed in the lambda expression but only one expression can be created in it. Some more examples are given below using lambda functions.

    add = lambda a,b,c : a + b + c
    print( add(5,4,6) )multiply = lambda x,y : x * y
    print( multiply(3,7) )power = lambda m,n : m ** n
    print( power(6,2) )

    Output

    輸出量

    15
    21
    36

    Map function in Python (Map function in Python)

    Map is a function used to trace the sequencing objects. The map function reduces great effort of applying some functions for each elements of collections such as list and dictionaries. Let us try to get a list of interest amount of each employee for an particular sum of money using normal way.

    Map is a function used to trace the sequencing objects. The map function reduces great effort of applying some functions for each elements of collections such as list and dictionaries. Let us try to get a list of interest amount of each employee for an particular sum of money using normal way.

    Photo by Honey Yanibel Minaya Cruz on Unsplash

    Photo by Honey Yanibel Minaya Cruz on Unsplash

    Syntax: map[]

    Syntax: map[]

    def interest(amount, rate, year):
    return amount * rate * year / 100amount = [10000, 12000, 15000]
    rate = 5
    year = 3for x in amount:
    y = interest(x, rate, year)
    print(y)

    Output

    輸出量

    1500.0
    1800.0
    2250.0

    The same can be done easily with the help of map function in Python. The following code is created using the map function.

    The same can be done easily with the help of map function in Python. The following code is created using the map function.

    def interest(amount):
    rate = 5
    year = 3
    return amount * rate * year / 100amount = [10000, 12000, 15000]interest_list = map(interest,amount)
    print( interest_list )

    Output

    輸出量

    <map object at 0x7fd6e45d90b8>

    Get confused with the output? The map function always return a map object. We have type cast the object using list keyword.

    Get confused with the output? The map function always return a map object. We have type cast the object using list keyword.

    def interest(amount):
    rate = 5
    year = 3
    return amount * rate * year / 100amount = [10000, 12000, 15000]interest_list = list( map(interest,amount) )
    print( interest_list )

    Output

    輸出量

    [1500.0, 1800.0, 2250.0]

    Map function is not only take the user defined function. We can use the built in function also.

    Map function is not only take the user defined function. We can use the built in function also.

    name = ["alex", "felix", "antony"]
    cap = list( map(str.capitalize, name))
    print(cap)

    Output

    輸出量

    ['Alex', 'Felix', 'Antony']

    Filter Function in Python (Filter Function in Python)

    In some times you have to filter some elements in a list based on some conditions. Let us consider a list of ages of ten persons. We have to filter the persons based on their age. If a person’s age is greater than or equal to 24 then they can be eligible to be in the list. In a normal way, we can use something like the following.

    In some times you have to filter some elements in a list based on some conditions. Let us consider a list of ages of ten persons. We have to filter the persons based on their age. If a person's age is greater than or equal to 24 then they can be eligible to be in the list. In a normal way, we can use something like the following.

    list_of_age = [10, 24, 27, 33, 30, 18, 17, 21, 26, 25]filtered_list = []for x in list_of_age:
    if(x>=24):
    filtered_list.append(x)print( filtered_list )

    Using filter function this can be very easy. The filter function returns an object that contains the elements that are true for certain conditions.

    Using filter function this can be very easy. The filter function returns an object that contains the elements that are true for certain conditions.

    Syntax: filter(function, iterables)

    Syntax: filter(function, iterables)

    def eligibility(age):
    if(age>=24):
    return True
    list_of_age = [10, 24, 27, 33, 30, 18, 17, 21, 26, 25]age = filter(eligibility, list_of_age)print(list(age))

    The output for the previous programs are given below.

    The output for the previous programs are given below.

    [24, 27, 33, 30, 26, 25]

    Reduce function in Python (Reduce function in Python)

    Reduce is a built in function in a module called functools. It reduces the size of iterable objects by applying function in each step. The syntax of reduce() function is given below.

    Reduce is a built in function in a module called functools. It reduces the size of iterable objects by applying function in each step. The syntax of reduce() function is given below.

    Syntax: reduce(function, iterables, start)

    Syntax: reduce(function, iterables, start)

    Let us consider a list of five numbers [1, 2, 3, 4, 5] from which you need to find the sum of the numbers. The reduce function first takes the numbers (1,2) then pass them through the defined function. Then the return value from the first one and the third value will be passed through the function. Let the name of the function be add() then the steps involved in finding the sum will be the following.

    Let us consider a list of five numbers [1, 2, 3, 4, 5] from which you need to find the sum of the numbers. The reduce function first takes the numbers (1,2) then pass them through the defined function. Then the return value from the first one and the third value will be passed through the function. Let the name of the function be add() then the steps involved in finding the sum will be the following.

    add(1, 2)
    add(add(1, 2) , 3)
    add(add(add(1, 2) , 3), 4)
    add(add(add(add(1, 2) , 3), 4),5)

    The actual code for the previous explanation is given below.

    The actual code for the previous explanation is given below.

    from functools import reduce
    def add(a,b):
    return a+b
    my_list = [1, 2, 3, 4, 5]
    sum = reduce(add, my_list)
    print(sum)

    Output

    輸出量

    15

    Combining Lambda with Map, Filter and Reduce (Combining Lambda with Map, Filter and Reduce)

    The higher order functions can replace the function object with the lambda expressions. The usage of lambda expression helps us to implement the discussed concept easily with a couple of lines of code.

    The higher order functions can replace the function object with the lambda expressions. The usage of lambda expression helps us to implement the discussed concept easily with a couple of lines of code.

    Lambda with Map (Lambda with Map)

    The following code will help you to know how to implement the map function with lambda. Let us try to create a list of power of a list.

    The following code will help you to know how to implement the map function with lambda. Let us try to create a list of power of a list.

    list_of_numbers = [10, 6, 5, 17, 15]
    order = 2
    power = map(lambda x : x ** order, list_of_numbers)
    print(list(power))

    Output

    輸出量

    [100, 36, 25, 289, 225]

    Lambda with Filter (Lambda with Filter)

    The conditional statements can be used with lambda expressions. Using the return value from the lambda function we can use filter the list.

    The conditional statements can be used with lambda expressions. Using the return value from the lambda function we can use filter the list.

    numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    even = list(filter(lambda x: x%2==0, numbers))
    print(even)

    Output

    輸出量

    [2, 4, 6, 8, 10]

    面向對象編程 (Object Oriented Programming)

    This world is made up of various objects. It may be a living thing or a non living thing, simply it can be called an Object. Objects can be categorized with the help of its behavior. Try to find the object from the instruction given here.

    This world is made up of various objects. It may be a living thing or a non living thing, simply it can be called an Object. Objects can be categorized with the help of its behavior. Try to find the object from the instruction given here.

    • The object has four wheels.

      The object has four wheels.
    • It contains an Engine.

      It contains an Engine.
    • It takes fuel to run.

      It takes fuel to run.

    Most of you could able to understand what I am describing about. It is a car. Here we have millions of cars in our world. Each of the cars are different objects. But all the cars can be classified into a group with the help of its behavior. In object oriented programming, each car is an object whereas the common blueprint that contains the behaviors of the object is called class.

    Most of you could able to understand what I am describing about. It is a car. Here we have millions of cars in our world. Each of the cars are different objects. But all the cars can be classified into a group with the help of its behavior. In object oriented programming, each car is an object whereas the common blueprint that contains the behaviors of the object is called class.

    Once a class with some properties is created, then any number of objects can be created under the class. The creation of an object under a class is called instantiation. To construct a class we should understand the behavior of objects clearly.

    Once a class with some properties is created, then any number of objects can be created under the class. The creation of an object under a class is called instantiation. To construct a class we should understand the behavior of objects clearly.

    The object-oriented model makes it easy to build up programs by accretion. What this often means, in practice, is that it provides a structured way to write spaghetti code.

    The object-oriented model makes it easy to build up programs by accretion. What this often means, in practice, is that it provides a structured way to write spaghetti code.

    insung yoon on insung yoon on UnsplashUnsplash

    Creating a Class in Python (Creating a Class in Python)

    A class in python is created using the keyword called class. The class name must follow the rules for creating identifiers in Python. Let us try to create a class with a name called car.

    A class in python is created using the keyword called class . The class name must follow the rules for creating identifiers in Python. Let us try to create a class with a name called car .

    Syntax: class name:

    Syntax: class name:

    To create an empty class in Python we can use the pass keyword. The following is the example of an empty class in python.

    To create an empty class in Python we can use the pass keyword. The following is the example of an empty class in python.

    class Car:
    pass

    Now the class Car is created. But there is no description of the car is given to the class. It simply creates the Car class. Still we can create an object under the Car class.

    Now the class Car is created. But there is no description of the car is given to the class. It simply creates the Car class. Still we can create an object under the Car class.

    How to Create an Object Under a Class (How to Create an Object Under a Class)

    Creating an object under a class is very simple. Let us try to create three cars under the Car class created in the previous code. Before that, we have to collect some information about the car. The following table describes the properties of each car.

    Creating an object under a class is very simple. Let us try to create three cars under the Car class created in the previous code. Before that, we have to collect some information about the car. The following table describes the properties of each car.

    Object Company Speed Color Year
    Car1 XYZ 125 RED 2019
    Car2 ABC 150 BLUE 2020
    Car3 LMN 200 YELLOW 2020

    Now we have to classify each information into different categories. The Car1, Car2 and Car3 are objects under the Car class. Company, Speed, Color, and Year are properties of the Cars. These properties will help us to create a blueprint for the Car objects.

    Now we have to classify each information into different categories. The Car1, Car2 and Car3 are objects under the Car class. Company, Speed, Color, and Year are properties of the Cars. These properties will help us to create a blueprint for the Car objects.

    Syntax: object_name = Class_name()

    Syntax: object_name = Class_name()

    class Car:
    pass
    Car1 = Car()
    Car2 = Car()
    Car3 = Car()

    Now all three cars are created as the objects under the class named Car. Now we can able to assign each property to the car objects.

    Now all three cars are created as the objects under the class named Car. Now we can able to assign each property to the car objects.

    class Car:
    pass
    Car1 = Car()
    Car2 = Car()
    Car3 = Car()Car1.company = "ABC"
    Car2.company = "XYZ"
    Car3.company = "LMN"

    The company name for each car object is assigned to the object using dot operator. We can assign all other values also.

    The company name for each car object is assigned to the object using dot operator. We can assign all other values also.

    class Car:
    pass
    Car1 = Car()
    Car2 = Car()
    Car3 = Car()Car1.company = "ABC"
    Car2.company = "XYZ"
    Car3.company = "LMN"Car1.speed = 125
    Car2.speed = 150
    Car3.speed = 200Car1.color = "RED"
    Car2.color = "BLUE"
    Car3.color = "YELLOW"Car1.year = 2019
    Car2.year = 2020
    Car3.year = 2020

    But this code doesn’t make any difference from the procedural programming. This is also like a normal value assignment for different variable names. Let us try to solve this using a method called constructor method in the following section.

    But this code doesn't make any difference from the procedural programming. This is also like a normal value assignment for different variable names. Let us try to solve this using a method called constructor method in the following section.

    Photo by Nick Fewings on Unsplash Nick Fewings在Unsplash上拍攝的照片

    Concept of Constructor Method (Concept of Constructor Method)

    The method __init__() is known as the constructor method in python. It helps us to create the blue print for the object. While using this constructor method the object instantiation will induce this method. That means, whenever you create a new object the __ini__ method will be called and whatever written in the method will be executed. Look at the following example in which we are trying to create an class with constructor instead of empty class.

    The method __init__() is known as the constructor method in python. It helps us to create the blue print for the object. While using this constructor method the object instantiation will induce this method. That means, whenever you create a new object the __ini__ method will be called and whatever written in the method will be executed. Look at the following example in which we are trying to create an class with constructor instead of empty class.

    class Car:
    def __init__(self):
    print("You created a new object")
    Car1 = Car()
    Car2 = Car()
    Car3 = Car()

    Output

    輸出量

    You created a new object
    You created a new object
    You created a new object

    We can use this ability of the constructor method to assign the value for each variable. In the above example, the constructor method defined with an argument called self . But while creating an object there is no argument is passed. Simply the argument passed during the instantiation will be n-1 where n is no of arguments described in the constructor method. Self takes the objects as the argument itself.

    We can use this ability of the constructor method to assign the value for each variable. In the above example, the constructor method defined with an argument called self . But while creating an object there is no argument is passed. Simply the argument passed during the instantiation will be n-1 where n is no of arguments described in the constructor method. Self takes the objects as the argument itself.

    class Car:
    def __init__(self,company,speed,color,year):
    self.company = company
    self.speed = speed
    self.color = color
    self.year = yearCar1 = Car("ABC",125,"RED",2019)
    Car2 = Car("XYZ",150,"BLUE",2020)
    Car3 = Car("LMN",200,"YELLOW",2020)

    This code is the same as the previous value assignment code. The actual parameters passed through the constructor method are Car1,"ABC",125, "RED",2019. Let me break down what happened while creating the object called Car1 .

    This code is the same as the previous value assignment code. The actual parameters passed through the constructor method are Car1,"ABC",125, "RED",2019. Let me break down what happened while creating the object called Car1 .

    When the object Car1 is created the __init__ () method inside the Car class will be called. It replaces the all self keyword into the object name. For example the self.company will be Car1.company , then the value is assigned to Car1.company . This is how the constructor method plays a vital role in object oriented programming with Python.

    When the object Car1 is created the __init__ () method inside the Car class will be called. It replaces the all self keyword into the object name. For example the self.company will be Car1.company , then the value is assigned to Car1.company . This is how the constructor method plays a vital role in object oriented programming with Python.

    Dane Deaner on Dane Deaner on UnsplashUnsplash

    Creating Methods for Objects (Creating Methods for Objects)

    A class can have not only the constructor method but also we can create our own method. In the previous code, we created a class with Cars. Let us try to create a method to get the values from the objects.

    A class can have not only the constructor method but also we can create our own method. In the previous code, we created a class with Cars. Let us try to create a method to get the values from the objects.

    class Car:
    def __init__(self,company,speed,color,year):
    self.company = company
    self.speed = speed
    self.color = color
    self.year = year
    def get_speed(self):
    print(self.speed)
    def get_company(self):
    print(self.company)
    def get_color(self):
    print(self.color)
    def get_year(self):
    print(self.year)Car1 = Car("ABC",125,"RED",2019)
    Car2 = Car("XYZ",150,"BLUE",2020)
    Car3 = Car("LMN",200,"YELLOW",2020)Car1.get_company()
    Car2.get_speed()
    Car3.get_color()

    Output

    輸出量

    XYZ
    150
    YELLOW

    Make Your Attribute Private using Encapsulation (Make Your Attribute Private using Encapsulation)

    Let us try to change the value of the speed of Car2 using normal value assignment. In the above code, the following statement will change the speed easily.

    Let us try to change the value of the speed of Car2 using normal value assignment. In the above code, the following statement will change the speed easily.

    Car2.speed = 250

    This clearly shows that there is no proper security over the information. Unfortunately, python doesn’t have any classification like public or private data. We can protect information by using a double underscore before the variable name.

    This clearly shows that there is no proper security over the information. Unfortunately, python doesn't have any classification like public or private data. We can protect information by using a double underscore before the variable name.

    class Car:
    def __init__(self,company,speed,color,year):
    self.__company = company
    self.__speed = speed
    self.__color = color
    self.__year = year
    def get_speed(self):
    print(self.__speed)
    def get_company(self):
    print(self.__company)
    def get_color(self):
    print(self.__color)
    def get_year(self):
    print(self.__year)Car1 = Car("ABC",125,"RED",2019)
    Car2 = Car("XYZ",150,"BLUE",2020)
    Car3 = Car("LMN",200,"YELLOW",2020)Car2.__speed = 250
    Car2.get_speed()

    Output

    輸出量

    200

    In the above code, the double __ protected the data so that the value of speed of the second car is still 200. This is called data protection or encapsulation in object oriented programming.

    In the above code, the double __ protected the data so that the value of speed of the second car is still 200. This is called data protection or encapsulation in object oriented programming.

    遺產 (Inheritance)

    Inheritance is the concept of creating relationship between a parent class and a child class which enables the code reusability. In inheritance, we just inherit the properties from parent class to child class. In inheritance, an object from a class can access a method defined in a different class.

    Inheritance is the concept of creating relationship between a parent class and a child class which enables the code reusability. In inheritance, we just inherit the properties from parent class to child class. In inheritance, an object from a class can access a method defined in a different class.

    Syntax: class name(parent):

    Syntax: class name(parent):

    Look at the following code in which we just added a class called Trike as a child for the Car class. Let us try to get the speed of trike1 from the method defined in the car class.

    Look at the following code in which we just added a class called Trike as a child for the Car class. Let us try to get the speed of trike1 from the method defined in the car class.

    class Car:
    def __init__(self,company,speed,color,year):
    self.company = company
    self.speed = speed
    self.color = color
    self.year = year
    def get_speed(self):
    print(self.speed)
    def get_company(self):
    print(self.company)
    def get_color(self):
    print(self.color)
    def get_year(self):
    print(self.year)class Trike(Car):
    def __init__(self,company,speed,color,year):
    self.company = company
    self.speed = speed
    self.color = color
    self.year = yearCar1 = Car("ABC",125,"RED",2019)
    Car2 = Car("XYZ",150,"BLUE",2020)
    Car3 = Car("LMN",200,"YELLOW",2020)Trike1 = Trike("GHJ",90,"Grey",2020)
    Trike2 = Trike("DFG",80,"Violet",2019)Trike1.get_speed()

    Output

    輸出量

    90

    In the above code Trike1 is an object created under the class name Trike. As the Trike class is created as a child of Car class, it can access the method get_speed which is defined in Car class.

    In the above code Trike1 is an object created under the class name Trike. As the Trike class is created as a child of Car class, it can access the method get_speed which is defined in Car class.

    Types of Inheritance (Types of Inheritance)

    Let us discuss four important types of Inheritance using code examples in the following sections. The types covered in this article are listed below.

    Let us discuss four important types of Inheritance using code examples in the following sections. The types covered in this article are listed below.

    • Single Inheritance

      單繼承
    • Multiple Inheritance

      多重繼承
    • Multilevel Inheritance

      Multilevel Inheritance
    • Hierarchical Inheritance

      層次繼承

    單繼承 (Single Inheritance)

    When a child class in a program has only one parent class then the type of inheritance is called single inheritance. The following code is an example of single inheritance.

    When a child class in a program has only one parent class then the type of inheritance is called single inheritance. The following code is an example of single inheritance.

    class Car:
    def __init__(self,company,speed,color,year):
    self.company = company
    self.speed = speed
    self.color = color
    self.year = year
    def get_speed(self):
    print(self.speed)
    def get_company(self):
    print(self.company)
    def get_color(self):
    print(self.color)
    def get_year(self):
    print(self.year)class Trike(Car):
    def __init__(self,company,speed,color,year):
    self.company = company
    self.speed = speed
    self.color = color
    self.year = yearCar1 = Car("ABC",125,"RED",2019)
    Car2 = Car("XYZ",150,"BLUE",2020)
    Car3 = Car("LMN",200,"YELLOW",2020)Trike1 = Trike("GHJ",90,"Grey",2020)
    Trike2 = Trike("DFG",80,"Violet",2019)Trike1.get_speed()
    Trike1.get_company()
    Trike2.get_color()
    Trike2.get_year()

    Output

    輸出量

    90
    GHJ
    Violet
    2019

    多重繼承 (Multiple Inheritance)

    In multiple inheritance, a child class will have more than one parent class. The objects created by the child class can access the methods defined in all the parent classes. In the above code, let us add one more class called Cycle. Here the get methods get_company and get_speed will be defined in the Car class and the methods get_color and get_year methods will be defined in Trike Class.

    In multiple inheritance, a child class will have more than one parent class. The objects created by the child class can access the methods defined in all the parent classes. In the above code, let us add one more class called Cycle. Here the get methods get_company and get_speed will be defined in the Car class and the methods get_color and get_year methods will be defined in Trike Class.

    class Car:
    def __init__(self,company,speed,color,year):
    self.company = company
    self.speed = speed
    self.color = color
    self.year = year
    def get_speed(self):
    print(self.speed)
    def get_company(self):
    print(self.company)class Trike():
    def __init__(self,company,speed,color,year):
    self.company = company
    self.speed = speed
    self.color = color
    self.year = year
    def get_color(self):
    print(self.color)
    def get_year(self):
    print(self.year)class Cycle(Car,Trike):
    def __init__(self,company,speed,color,year):
    self.company = company
    self.speed = speed
    self.color = color
    self.year = yearCar1 = Car("ABC",125,"RED",2019)
    Car2 = Car("XYZ",150,"BLUE",2020)
    Car3 = Car("LMN",200,"YELLOW",2020)Trike1 = Trike("GHJ",90,"Grey",2020)
    Trike2 = Trike("DFG",80,"Violet",2019)Cycle1 = Cycle("WER",30,"RED",2020)Cycle1.get_company()
    Cycle1.get_color()

    Output

    輸出量

    WER
    RED

    多級繼承 (Multi Level Inheritance)

    Multilevel inheritance is a type of inheritance in which the child class is used as a parent of another child class. The child class can access the methods of the parent of its parent class.

    Multilevel inheritance is a type of inheritance in which the child class is used as a parent of another child class. The child class can access the methods of the parent of its parent class.

    class Car:
    def __init__(self,company,speed,color,year):
    self.company = company
    self.speed = speed
    self.color = color
    self.year = year
    def get_speed(self):
    print(self.speed)
    def get_company(self):
    print(self.company)
    def get_color(self):
    print(self.color)
    def get_year(self):
    print(self.year)class Trike(Car):
    def __init__(self,company,speed,color,year):
    self.company = company
    self.speed = speed
    self.color = color
    self.year = yearclass Cycle(Trike):
    def __init__(self,company,speed,color,year):
    self.company = company
    self.speed = speed
    self.color = color
    self.year = yearCar1 = Car("ABC",125,"RED",2019)
    Car2 = Car("XYZ",150,"BLUE",2020)
    Car3 = Car("LMN",200,"YELLOW",2020)Trike1 = Trike("GHJ",90,"Grey",2020)
    Trike2 = Trike("DFG",80,"Violet",2019)Cycle1 = Cycle("WER",30,"RED",2020)Cycle1.get_company()
    Cycle1.get_color()

    Output

    輸出量

    WER
    RED

    層次繼承 (Hierarchical Inheritance)

    If more than one child having the same parent, then the type of inheritance is called hierarchical inheritance. All the children created using the same parent can inherit from the class.

    If more than one child having the same parent, then the type of inheritance is called hierarchical inheritance. All the children created using the same parent can inherit from the class.

    class Car:
    def __init__(self,company,speed,color,year):
    self.company = company
    self.speed = speed
    self.color = color
    self.year = year
    def get_speed(self):
    print(self.speed)
    def get_company(self):
    print(self.company)
    def get_color(self):
    print(self.color)
    def get_year(self):
    print(self.year)class Trike(Car):
    def __init__(self,company,speed,color,year):
    self.company = company
    self.speed = speed
    self.color = color
    self.year = yearclass Cycle(Car):
    def __init__(self,company,speed,color,year):
    self.company = company
    self.speed = speed
    self.color = color
    self.year = yearCar1 = Car("ABC",125,"RED",2019)
    Car2 = Car("XYZ",150,"BLUE",2020)
    Car3 = Car("LMN",200,"YELLOW",2020)Trike1 = Trike("GHJ",90,"Grey",2020)
    Trike2 = Trike("DFG",80,"Violet",2019)Cycle1 = Cycle("WER",30,"RED",2020)Trike1.get_company()
    Cycle1.get_color()

    Output

    輸出量

    GHJ
    RED

    Hybrid Inheritance (Hybrid Inheritance)

    Hybrid Inheritance contains a mixture of various types of inheritance in one program. Try to build a program with hybrid inheritance yourself.

    Hybrid Inheritance contains a mixture of various types of inheritance in one program. Try to build a program with hybrid inheritance yourself.

    The usage of a file system is an important thing in the field of computer science. It is the most common method used to store required information in various formats. Usually, every programmer will use standard input output methods to test a logical concept. But, In the real time computing systems the standard input output operations is not only enough. When we use standard IO method in a program, the output will remain until the execution ends. File system is the best solution to store the information permanently in a memory device of a computer. This article will help you to understand the basics of file handling and advanced functions in file handling in python.

    The usage of a file system is an important thing in the field of computer science. It is the most common method used to store required information in various formats. Usually, every programmer will use standard input output methods to test a logical concept. But, In the real time computing systems the standard input output operations is not only enough. When we use standard IO method in a program, the output will remain until the execution ends. File system is the best solution to store the information permanently in a memory device of a computer. This article will help you to understand the basics of file handling and advanced functions in file handling in python.

    A Computer File (A Computer File)

    A computer file is a virtual environment that acts as a container for various types of information. Consider the real world, we have a lot of stuffs such as papers and books to store information. The computer needs a system same as that. The file system combines various files in a memory device with the help of directory. Directory of a file is a string that denotes where the file is stored in the memory disc.

    A computer file is a virtual environment that acts as a container for various types of information. Consider the real world, we have a lot of stuffs such as papers and books to store information. The computer needs a system same as that. The file system combines various files in a memory device with the help of directory. Directory of a file is a string that denotes where the file is stored in the memory disc.

    The directory can be considered as the address of the file. A file can be stored in different folders in a drive. Each folder is separated by a back slash (\). A file name will contain two parts. They are file name and extension. File name is a unique string used to name the file. The extension is the suffix used after the file name to denote the type of file. The structure of a file directory is given below.

    The directory can be considered as the address of the file. A file can be stored in different folders in a drive. Each folder is separated by a back slash (\). A file name will contain two parts. They are file name and extension. File name is a unique string used to name the file. The extension is the suffix used after the file name to denote the type of file. The structure of a file directory is given below.

    Structure of File DirectoryStructure of File Directory

    The file name and the extension must be separated by a dot. The file name should not contain any special character in it. The example extensions are .mp4, .mp3.

    The file name and the extension must be separated by a dot. The file name should not contain any special character in it. The example extensions are .mp4, .mp3.

    Files in Python (Files in Python)

    Even though we have various file formats in our computer, the in-built methods in python can handle two major types of files. The types are text files and binary files. The text and binary files has .txt and .bin as their extensions respectively. We have to understand both types of files. Text files are used to store human readable information whereas the binary files contains computer readable information that are written using binary digits 0s and 1s.

    Even though we have various file formats in our computer, the in-built methods in python can handle two major types of files. The types are text files and binary files. The text and binary files has .txt and .bin as their extensions respectively. We have to understand both types of files. Text files are used to store human readable information whereas the binary files contains computer readable information that are written using binary digits 0s and 1s.

    Classification of Files in PythonClassification of Files in Python

    The file processing in python is done by two different types of approaches. One is processing the content in the file. Another one is processing the directory. The first one can be done by the built in functions. The second one will be processed by the os module methods. In this article we will concentrate only on the file content manipulation.

    The file processing in python is done by two different types of approaches. One is processing the content in the file. Another one is processing the directory. The first one can be done by the built in functions. The second one will be processed by the os module methods. In this article we will concentrate only on the file content manipulation.

    Operations on File (Operations on File)

    The operations performed on a file is called the file operation. Following is the list of operations can be applied on a file in python.

    The operations performed on a file is called the file operation. Following is the list of operations can be applied on a file in python.

  • Opening or Creating a File

    Opening or Creating a File
  • Writing a File

    Writing a File
  • Reading a File

    Reading a File
  • Closing a File

    Closing a File
  • Renaming a File

    Renaming a File
  • Deleting a File

    Deleting a File
  • Opening or Creating a New File in Python (Opening or Creating a New File in Python)

    The very first thing to do in file handling is the creation of file. The method open() is used to open an existing file or creating a new file. If the complete directory is not given then the file will be created in the directory in which the python file is stored. The syntax for using open() method is given below.

    The very first thing to do in file handling is the creation of file. The method open() is used to open an existing file or creating a new file. If the complete directory is not given then the file will be created in the directory in which the python file is stored. The syntax for using open() method is given below.

    Syntax: file_object = open( file_name, “Access Mode”, Buffering )

    Syntax: file_object = open ( file_name, “Access Mode”, Buffering )

    File name is a unique name in a directory. The open() function will create the file with the specified name if it is not already exists otherwise it will open the already existing file. The open method returns file object which can be stored in the name file_object.

    File name is a unique name in a directory. The open() function will create the file with the specified name if it is not already exists otherwise it will open the already existing file. The open method returns file object which can be stored in the name file_object .

    The access mode is the string which tells in what mode the file should be opened for operations. There are three different access modes are available in python.

    The access mode is the string which tells in what mode the file should be opened for operations. There are three different access modes are available in python.

    Reading: Reading mode is crated only for reading the file. The pointer will be at the beginning of the file.

    R eading: Reading mode is crated only for reading the file. The pointer will be at the beginning of the file.

    Writing: Writing mode is used for overwriting the information on existing file.

    Writing: Writing mode is used for overwriting the information on existing file.

    Append: Append mode is same as the writing mode. Instead of over writing the information this mode append the information at the end.

    Append: Append mode is same as the writing mode. Instead of over writing the information this mode append the information at the end.

    Below is the list of representation of various access modes in python.

    Below is the list of representation of various access modes in python.

    Reading ModeR - Opens a text file for Reading
    Rb - Opens a binary file for Reading
    r+ - Opens a text file for Reading and Writing
    rb+ - Opens a binary file for Reading and WritingWriting ModeW - Opens a text file for Writing
    Wb - Opens a binary file for Writing
    w+ - Opens a text file for Reading and Writing
    wb+ - Opens a binary file for Reading and WritingAppend ModeA - Opens a text file for appending
    Ab - Opens a binary file for appending
    a+ - Opens a text file for appending and reading
    ab+ - Opens a binary file for appending and reading

    What is Buffering ? (What is Buffering ?)

    Buffering is the process of storing a chunk of a file in a temporary memory until the file loads completely. In python there are different values can be given. If the buffering is set to 0 , then the buffering is off. The buffering will be set to 1 when we need to buffer the file.

    Buffering is the process of storing a chunk of a file in a temporary memory until the file loads completely. In python there are different values can be given. If the buffering is set to 0 , then the buffering is off. The buffering will be set to 1 when we need to buffer the file.

    Creating our first file (Creating our first file)

    We have discussed lot of theoretical part in the article. Let us try to create a file object in python. Before creating a file object we have to decide proper attributes to be applied. The major three things in file object creation are file name, access mode and buffering. Let the file name be my_file_name . We are going to create a new file in the text format. We have to write something on the file. So choosing the mode for reading and writing will be perfect one. As I am going to create text based file, I can choose the mode w+ for the file. Buffering can be used for text type file. So we can enable the buffering.

    We have discussed lot of theoretical part in the article. Let us try to create a file object in python. Before creating a file object we have to decide proper attributes to be applied. The major three things in file object creation are file name, access mode and buffering. Let the file name be my_file_name . We are going to create a new file in the text format. We have to write something on the file. So choosing the mode for reading and writing will be perfect one. As I am going to create text based file, I can choose the mode w+ for the file. Buffering can be used for text type file. So we can enable the buffering.

    my_file = open(my_file_name.txt,"w+",1)

    Now a text file with the name my_file_name is created successfully. We can able to apply various methods on the file object. Here is the list of useful methods used on file object.

    Now a text file with the name my_file_name is created successfully. We can able to apply various methods on the file object. Here is the list of useful methods used on file object.

    file.name - Returns the name of file
    file.mode - Returns the access mode of the file
    file.closed - Returns true if the file is closed

    Let us apply all the methods on our file object my_file .

    Let us apply all the methods on our file object my_file .

    my_file = open("my_file_name.txt", "w+", 1)
    print(my_file.name)
    print(my_file.mode)
    print(my_file.closed)

    Output

    輸出量

    my_file_name.txt
    w+
    False

    Let us try the same with the r+ access mode instead of w+ .

    Let us try the same with the r+ access mode instead of w+ .

    my_file = open("my_file_name.txt", "r+", 1)
    print(my_file.name)
    print(my_file.mode)
    print(my_file.closed)

    Output

    輸出量

    Traceback (most recent call last):
    File "main.py", line 1, in <module>
    my_file = open("my_file_name.txt", "r+", 1)
    FileNotFoundError: [Errno 2] No such file or directory: 'my_file_name.txt'

    If you need to use r+ the file must present already in the directory. Otherwise it will give some error. As we created a new file there is no information available in the text file. You can check manually by opening the file in the directory.

    If you need to use r+ the file must present already in the directory. Otherwise it will give some error. As we created a new file there is no information available in the text file. You can check manually by opening the file in the directory.

    Writing Information in the File (Writing Information in the File)

    In the previous step we have created a file for reading and writing modes. In this part we will write something in the text document. The write() method is used for writing a string inside a file. The syntax for using write function is given below.

    In the previous step we have created a file for reading and writing modes. In this part we will write something in the text document. The write() method is used for writing a string inside a file. The syntax for using write function is given below.

    Syntax: file_object.write(“String”)

    Syntax: file_object .write(“String”)

    string = "This is a String in Python"
    my_file = open(my_file_name.txt,"w+",1)my_file.write(string)

    Now the information will be written in the text file. This information will be saved once we close the file.

    Now the information will be written in the text file. This information will be saved once we close the file.

    Reading Information in the File (Reading Information in the File)

    The text information in the text file can be extracted with the help of read() function. The syntax for reading is given below.

    The text information in the text file can be extracted with the help of read() function. The syntax for reading is given below.

    Syntax: var_name = file_object.read(index)

    Syntax: var_name = file_object .read(index)

    string = "This is a String in Python"
    my_file = open(my_file_name.txt,"r+",1)
    my_file.write(string)my_string = my_file.read()
    print(my_string)

    Output

    輸出量

    This is a String in Python

    The index argument passed inside the read() method determines how many characters to be printed from the file.

    The index argument passed inside the read() method determines how many characters to be printed from the file.

    Closing a File in Python (Closing a File in Python)

    The previous programs are not suggested for real time. After processing the content in a file, the file must be saved and closed. To do this we can use another method close() for closing the file. This is an important method to be remembered while handling files in python.

    The previous programs are not suggested for real time. After processing the content in a file, the file must be saved and closed. To do this we can use another method close() for closing the file. This is an important method to be remembered while handling files in python.

    Syntax: file_object.close()

    Syntax: file_object .close()

    string = "This is a String in Python"
    my_file = open(my_file_name.txt,"w+",1)
    my_file.write(string)
    my_file.close()
    print(my_file.closed)

    Output

    輸出量

    True

    The method file.closed returns True as the file is closed.

    The method file.closed returns True as the file is closed.

    Renaming a File (Renaming a File)

    The file name can be changed by a method rename() . The rename() method is available in the os module. Before calling the rename function we have to import the os module into our program. The syntax is given below.

    The file name can be changed by a method rename() . The rename() method is available in the os module. Before calling the rename function we have to import the os module into our program. The syntax is given below.

    Syntax: os.rename(old_name, new_name)

    Syntax: os .rename(old_name, new_name)

    import os
    string = "This is a String in Python"
    my_file = open("my_file_name.txt", "w+", 1)
    my_file.write(string)
    os.rename("my_file_name.txt", "renamed.txt")

    Now the file will be renamed into the new name.

    Now the file will be renamed into the new name.

    Deleting a File (Deleting a File)

    Another method from the same os module, remove() is used to delete an existing file in a directory. The following is the syntax for using delete operation.

    Another method from the same os module, remove() is used to delete an existing file in a directory. The following is the syntax for using delete operation.

    Syntax: os.remove(file_name)

    Syntax: os .remove(file_name)

    import os
    string = "This is a String in Python"
    my_file = open("my_file_name.txt", "w+", 1)
    my_file.write(string)
    os.remove("my_file_name.txt")

    Thank you all for spending your precious time on my writing. This very long tutorial comprises of my previous articles written by me. Most of the readers asked me to give all things at one place. Here It is. Thank you again for the love and support. ??????

    Thank you all for spending your precious time on my writing. This very long tutorial comprises of my previous articles written by me. Most of the readers asked me to give all things at one place. Here It is. Thank you again for the love and support. ??????

    If you need any guidance for learning python, just connect me with the email id provided. mydigitalwallets@gmail.com.

    If you need any guidance for learning python, just connect me with the email id provided. mydigitalwallets@gmail.com .

    Follow me on Medium

    跟我來

    翻譯自: https://towardsdatascience.com/a-complete-walk-through-in-python-for-beginners-bf59a1f04296

    python初學者

    總結

    以上是生活随笔為你收集整理的python初学者_初学者使用Python的完整介绍的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

    久久久中文久久久无码 | 欧美肥老太牲交大战 | 中文字幕乱码中文乱码51精品 | 国产成人精品一区二区在线小狼 | 国产一区二区三区影院 | 国产免费无码一区二区视频 | 亚洲人成网站色7799 | 久久人人爽人人爽人人片av高清 | 国产特级毛片aaaaaa高潮流水 | 牲欲强的熟妇农村老妇女视频 | 欧美猛少妇色xxxxx | 蜜桃臀无码内射一区二区三区 | 国产精品va在线播放 | 亚洲国产精品成人久久蜜臀 | 亚洲国产高清在线观看视频 | 国产乱人伦偷精品视频 | 国产成人综合美国十次 | 夜夜影院未满十八勿进 | 国产精品怡红院永久免费 | 婷婷丁香五月天综合东京热 | 99久久99久久免费精品蜜桃 | 久激情内射婷内射蜜桃人妖 | 偷窥日本少妇撒尿chinese | 久久久www成人免费毛片 | 亚洲精品无码人妻无码 | 天堂а√在线中文在线 | 人妻互换免费中文字幕 | 日本一区二区三区免费高清 | 四虎4hu永久免费 | 免费无码的av片在线观看 | 永久黄网站色视频免费直播 | 国内精品久久毛片一区二区 | 国产午夜精品一区二区三区嫩草 | 免费无码一区二区三区蜜桃大 | 亚洲精品一区二区三区大桥未久 | 中文字幕乱码人妻二区三区 | 粗大的内捧猛烈进出视频 | 久久精品女人天堂av免费观看 | 中文字幕日产无线码一区 | 亚洲熟妇色xxxxx亚洲 | 免费无码的av片在线观看 | 麻豆国产人妻欲求不满谁演的 | 久久国产精品精品国产色婷婷 | 国产极品美女高潮无套在线观看 | 日日噜噜噜噜夜夜爽亚洲精品 | 久久无码人妻影院 | 久久人人爽人人爽人人片ⅴ | 亚洲日韩精品欧美一区二区 | 亚洲小说春色综合另类 | 亚洲欧洲无卡二区视頻 | 又大又黄又粗又爽的免费视频 | 日韩欧美中文字幕在线三区 | 欧美日本精品一区二区三区 | 人妻无码αv中文字幕久久琪琪布 | 国产精品无码成人午夜电影 | 亚洲中文字幕无码一久久区 | 无码人妻丰满熟妇区毛片18 | 亚洲精品国产精品乱码视色 | 少妇太爽了在线观看 | 色噜噜亚洲男人的天堂 | 中文字幕人成乱码熟女app | 久激情内射婷内射蜜桃人妖 | 亚洲中文字幕无码一久久区 | 51国偷自产一区二区三区 | 久久精品国产精品国产精品污 | 国产熟妇另类久久久久 | 亚洲中文字幕无码中文字在线 | 亚洲精品中文字幕久久久久 | 国産精品久久久久久久 | 日韩精品成人一区二区三区 | 国产福利视频一区二区 | 国产精品资源一区二区 | 欧美性猛交内射兽交老熟妇 | 久久精品人人做人人综合 | 日本熟妇大屁股人妻 | 免费人成在线观看网站 | 欧美35页视频在线观看 | 国产无遮挡又黄又爽免费视频 | 国产日产欧产精品精品app | 日本一区二区三区免费播放 | 无码福利日韩神码福利片 | 日韩人妻无码中文字幕视频 | 国产无套内射久久久国产 | 中文字幕乱码中文乱码51精品 | 人人妻人人藻人人爽欧美一区 | 久久无码人妻影院 | 国内精品一区二区三区不卡 | 奇米综合四色77777久久 东京无码熟妇人妻av在线网址 | 国产xxx69麻豆国语对白 | 伊在人天堂亚洲香蕉精品区 | 欧美黑人巨大xxxxx | 色偷偷人人澡人人爽人人模 | 亚洲色在线无码国产精品不卡 | 亚洲日韩av片在线观看 | 中文字幕无线码 | 成人片黄网站色大片免费观看 | 特大黑人娇小亚洲女 | 综合激情五月综合激情五月激情1 | 在线a亚洲视频播放在线观看 | 特级做a爰片毛片免费69 | 老司机亚洲精品影院 | 欧美性生交xxxxx久久久 | 国产偷国产偷精品高清尤物 | 宝宝好涨水快流出来免费视频 | 俺去俺来也在线www色官网 | 日韩精品一区二区av在线 | 蜜桃无码一区二区三区 | 久久久精品456亚洲影院 | 久久天天躁狠狠躁夜夜免费观看 | 76少妇精品导航 | 色综合久久久无码中文字幕 | 色偷偷av老熟女 久久精品人妻少妇一区二区三区 | 久久综合九色综合欧美狠狠 | 人人爽人人爽人人片av亚洲 | 国产小呦泬泬99精品 | 国产口爆吞精在线视频 | 四虎国产精品免费久久 | 久久精品女人的天堂av | 欧美乱妇无乱码大黄a片 | 一本色道婷婷久久欧美 | 1000部啪啪未满十八勿入下载 | 亚洲国产精华液网站w | 日日摸夜夜摸狠狠摸婷婷 | 成人三级无码视频在线观看 | 国产美女极度色诱视频www | 一本加勒比波多野结衣 | 久久久久成人片免费观看蜜芽 | 鲁一鲁av2019在线 | 欧美性黑人极品hd | 亚欧洲精品在线视频免费观看 | 国产精品亚洲一区二区三区喷水 | 少妇无套内谢久久久久 | 亚洲自偷自偷在线制服 | 欧美老妇交乱视频在线观看 | 草草网站影院白丝内射 | 对白脏话肉麻粗话av | 亚欧洲精品在线视频免费观看 | 波多野结衣 黑人 | 天天躁日日躁狠狠躁免费麻豆 | 国内揄拍国内精品人妻 | 网友自拍区视频精品 | 免费男性肉肉影院 | 亚洲熟妇自偷自拍另类 | 成人无码影片精品久久久 | 影音先锋中文字幕无码 | 黑人巨大精品欧美黑寡妇 | 人人爽人人爽人人片av亚洲 | 综合人妻久久一区二区精品 | 99re在线播放 | 丝袜 中出 制服 人妻 美腿 | 国产片av国语在线观看 | 国产美女极度色诱视频www | 人妻与老人中文字幕 | 久久午夜无码鲁丝片秋霞 | 性欧美videos高清精品 | 精品人妻av区 | 特黄特色大片免费播放器图片 | 日本丰满护士爆乳xxxx | 国产午夜无码精品免费看 | 国产精品内射视频免费 | 国产精品久久久一区二区三区 | 性史性农村dvd毛片 | 色欲久久久天天天综合网精品 | 日本欧美一区二区三区乱码 | 欧美大屁股xxxxhd黑色 | 亚洲成a人片在线观看无码 | 中文字幕+乱码+中文字幕一区 | 双乳奶水饱满少妇呻吟 | 亚洲国产一区二区三区在线观看 | 免费中文字幕日韩欧美 | 澳门永久av免费网站 | 色一情一乱一伦一区二区三欧美 | 日韩av无码一区二区三区 | 窝窝午夜理论片影院 | 精品欧洲av无码一区二区三区 | 欧美日韩视频无码一区二区三 | 亚洲国产欧美国产综合一区 | 天堂а√在线地址中文在线 | 成人精品天堂一区二区三区 | 欧美自拍另类欧美综合图片区 | 国产美女极度色诱视频www | 正在播放老肥熟妇露脸 | 国产成人无码专区 | 中文字幕久久久久人妻 | 又黄又爽又色的视频 | 国产极品视觉盛宴 | 成人女人看片免费视频放人 | 香港三级日本三级妇三级 | 日韩无套无码精品 | 97资源共享在线视频 | 亚洲国产精品久久久天堂 | 婷婷丁香六月激情综合啪 | 亚洲 a v无 码免 费 成 人 a v | 东北女人啪啪对白 | 日本爽爽爽爽爽爽在线观看免 | 在线精品国产一区二区三区 | 爆乳一区二区三区无码 | 丰满诱人的人妻3 | 午夜丰满少妇性开放视频 | 亚洲精品中文字幕 | 在线欧美精品一区二区三区 | 伊人久久婷婷五月综合97色 | 精品人人妻人人澡人人爽人人 | 最近中文2019字幕第二页 | 亚洲精品一区三区三区在线观看 | 欧美自拍另类欧美综合图片区 | 国产熟女一区二区三区四区五区 | 极品嫩模高潮叫床 | 国产真实夫妇视频 | 欧美日韩色另类综合 | 国内老熟妇对白xxxxhd | 欧美老妇交乱视频在线观看 | 亚洲欧洲日本综合aⅴ在线 | 夜精品a片一区二区三区无码白浆 | 日本熟妇浓毛 | av人摸人人人澡人人超碰下载 | 亚洲一区二区三区在线观看网站 | 欧美老妇交乱视频在线观看 | 日日麻批免费40分钟无码 | 亚洲综合久久一区二区 | 波多野42部无码喷潮在线 | 黑人粗大猛烈进出高潮视频 | 日本精品少妇一区二区三区 | 日本爽爽爽爽爽爽在线观看免 | 国产艳妇av在线观看果冻传媒 | 欧美老人巨大xxxx做受 | 欧美xxxxx精品 | 成人毛片一区二区 | 精品国产麻豆免费人成网站 | 色综合久久久久综合一本到桃花网 | 久久久久久久久888 | 乱人伦人妻中文字幕无码久久网 | 蜜臀aⅴ国产精品久久久国产老师 | 午夜精品久久久内射近拍高清 | 无码av最新清无码专区吞精 | 无码人妻少妇伦在线电影 | 国产在线aaa片一区二区99 | 国产人妻久久精品二区三区老狼 | 欧美人与动性行为视频 | 亚洲の无码国产の无码步美 | 国产午夜无码精品免费看 | 荫蒂添的好舒服视频囗交 | 中文精品无码中文字幕无码专区 | 天堂亚洲2017在线观看 | 国产超碰人人爽人人做人人添 | 国产精品高潮呻吟av久久 | 午夜福利一区二区三区在线观看 | 内射白嫩少妇超碰 | 西西人体www44rt大胆高清 | 久久99精品久久久久久动态图 | √8天堂资源地址中文在线 | 国产美女极度色诱视频www | 亚洲国产av精品一区二区蜜芽 | 色窝窝无码一区二区三区色欲 | 人人妻在人人 | 国内老熟妇对白xxxxhd | 自拍偷自拍亚洲精品被多人伦好爽 | 永久免费精品精品永久-夜色 | 精品国产av色一区二区深夜久久 | 夜精品a片一区二区三区无码白浆 | 精品人妻人人做人人爽 | 欧美大屁股xxxxhd黑色 | √天堂资源地址中文在线 | 影音先锋中文字幕无码 | 国产成人午夜福利在线播放 | 久久精品中文字幕大胸 | 亚洲精品午夜国产va久久成人 | 国产农村妇女高潮大叫 | 久久天天躁夜夜躁狠狠 | 综合人妻久久一区二区精品 | 国产成人精品久久亚洲高清不卡 | 久久国产精品偷任你爽任你 | 无码国产乱人伦偷精品视频 | ass日本丰满熟妇pics | 亚洲日韩精品欧美一区二区 | 波多野结衣av在线观看 | 成人免费无码大片a毛片 | 亚洲国产精品久久久天堂 | 天天躁日日躁狠狠躁免费麻豆 | 欧美日韩色另类综合 | 无码人妻久久一区二区三区不卡 | 国产香蕉尹人视频在线 | 国产成人无码av片在线观看不卡 | 精品成在人线av无码免费看 | 日韩亚洲欧美中文高清在线 | 又紧又大又爽精品一区二区 | 国产精品igao视频网 | 人妻人人添人妻人人爱 | 中文亚洲成a人片在线观看 | 99久久精品午夜一区二区 | 国产小呦泬泬99精品 | 久久精品中文字幕大胸 | 99久久亚洲精品无码毛片 | 精品无人区无码乱码毛片国产 | 亚洲精品综合一区二区三区在线 | 日日夜夜撸啊撸 | aⅴ在线视频男人的天堂 | 国产精品毛片一区二区 | 成人无码精品1区2区3区免费看 | 久久久亚洲欧洲日产国码αv | 久久精品国产99久久6动漫 | 亚洲乱码国产乱码精品精 | 国产在线精品一区二区三区直播 | 无码人妻精品一区二区三区下载 | 九九久久精品国产免费看小说 | 国产两女互慰高潮视频在线观看 | 草草网站影院白丝内射 | 亚洲精品久久久久中文第一幕 | 美女极度色诱视频国产 | 国产精品久久久av久久久 | 国产高清不卡无码视频 | av无码电影一区二区三区 | 午夜熟女插插xx免费视频 | 成熟妇人a片免费看网站 | 精品久久久久久人妻无码中文字幕 | 久久综合狠狠综合久久综合88 | 国产精品亚洲五月天高清 | 亚洲无人区一区二区三区 | 毛片内射-百度 | 国产超级va在线观看视频 | 国产成人久久精品流白浆 | 色欲人妻aaaaaaa无码 | 麻豆成人精品国产免费 | 色欲人妻aaaaaaa无码 | 特黄特色大片免费播放器图片 | 亚洲精品一区二区三区婷婷月 | 亚洲人成影院在线无码按摩店 | 99er热精品视频 | 日本肉体xxxx裸交 | 国产精品香蕉在线观看 | 无码毛片视频一区二区本码 | 亚洲国产精品无码一区二区三区 | 特级做a爰片毛片免费69 | 国内丰满熟女出轨videos | 国产成人综合在线女婷五月99播放 | 国产av人人夜夜澡人人爽麻豆 | 久久综合激激的五月天 | 久久久久久久女国产乱让韩 | 亲嘴扒胸摸屁股激烈网站 | 最新国产乱人伦偷精品免费网站 | 中文字幕无码视频专区 | 人妻少妇精品久久 | 亚洲人成网站在线播放942 | 久久精品女人天堂av免费观看 | 国语自产偷拍精品视频偷 | 精品日本一区二区三区在线观看 | 日韩人妻系列无码专区 | 精品国精品国产自在久国产87 | 久久久www成人免费毛片 | 日本爽爽爽爽爽爽在线观看免 | 欧美熟妇另类久久久久久多毛 | aⅴ亚洲 日韩 色 图网站 播放 | 精品厕所偷拍各类美女tp嘘嘘 | 亚洲精品www久久久 | www一区二区www免费 | 国产午夜福利亚洲第一 | 午夜成人1000部免费视频 | 奇米影视7777久久精品 | 97色伦图片97综合影院 | 中文字幕无码人妻少妇免费 | 日韩av无码一区二区三区不卡 | 免费观看激色视频网站 | 无码人妻少妇伦在线电影 | 国产乱人伦app精品久久 国产在线无码精品电影网 国产国产精品人在线视 | 丰满少妇人妻久久久久久 | 国产婷婷色一区二区三区在线 | 久久久久久a亚洲欧洲av冫 | 欧美日韩人成综合在线播放 | 日本www一道久久久免费榴莲 | 熟妇激情内射com | 亚洲男人av天堂午夜在 | 中文字幕无码免费久久9一区9 | 久久99精品国产.久久久久 | 少妇厨房愉情理9仑片视频 | 亚洲阿v天堂在线 | 一区二区传媒有限公司 | 国产美女精品一区二区三区 | 欧美丰满熟妇xxxx性ppx人交 | 精品欧洲av无码一区二区三区 | 少妇激情av一区二区 | 5858s亚洲色大成网站www | 乱人伦人妻中文字幕无码 | 秋霞成人午夜鲁丝一区二区三区 | 日本一卡2卡3卡4卡无卡免费网站 国产一区二区三区影院 | 国产又爽又黄又刺激的视频 | 中文久久乱码一区二区 | 国产精品第一国产精品 | 少妇性l交大片欧洲热妇乱xxx | 欧美人与禽zoz0性伦交 | 18禁黄网站男男禁片免费观看 | 色一情一乱一伦一区二区三欧美 | 欧美性黑人极品hd | 亚洲精品国产第一综合99久久 | 九九热爱视频精品 | 欧美性黑人极品hd | 男人的天堂2018无码 | 丰满岳乱妇在线观看中字无码 | 国产在线精品一区二区三区直播 | 奇米影视7777久久精品人人爽 | 国内老熟妇对白xxxxhd | 亚洲熟妇色xxxxx欧美老妇 | 国产两女互慰高潮视频在线观看 | 东京热无码av男人的天堂 | 爱做久久久久久 | 色偷偷av老熟女 久久精品人妻少妇一区二区三区 | 国产色xx群视频射精 | 大色综合色综合网站 | 少妇太爽了在线观看 | 少妇性l交大片 | 久久综合给合久久狠狠狠97色 | 永久免费观看美女裸体的网站 | 午夜性刺激在线视频免费 | 在线a亚洲视频播放在线观看 | 最新国产乱人伦偷精品免费网站 | 国产av无码专区亚洲a∨毛片 | 少妇性l交大片 | 秋霞特色aa大片 | 欧美日韩一区二区免费视频 | 精品国产一区二区三区四区在线看 | av无码久久久久不卡免费网站 | 久久久中文久久久无码 | 精品人妻人人做人人爽夜夜爽 | 蜜臀aⅴ国产精品久久久国产老师 | 丝袜 中出 制服 人妻 美腿 | 国产精品久久久久7777 | 人妻aⅴ无码一区二区三区 | 国产后入清纯学生妹 | 久青草影院在线观看国产 | 亚洲男女内射在线播放 | 亚洲а∨天堂久久精品2021 | 男女爱爱好爽视频免费看 | 动漫av网站免费观看 | 亚洲欧美国产精品久久 | 久久精品丝袜高跟鞋 | 亚洲 日韩 欧美 成人 在线观看 | 熟妇人妻无乱码中文字幕 | 高潮毛片无遮挡高清免费 | 无码国内精品人妻少妇 | 中文字幕无码人妻少妇免费 | 国内精品人妻无码久久久影院 | 国产精品久久久久久久9999 | 亚洲娇小与黑人巨大交 | 中文字幕精品av一区二区五区 | 中文字幕无码视频专区 | 日韩在线不卡免费视频一区 | 国产精品福利视频导航 | 中文字幕人成乱码熟女app | 国产精品香蕉在线观看 | 欧美日韩在线亚洲综合国产人 | 扒开双腿疯狂进出爽爽爽视频 | 中文精品无码中文字幕无码专区 | 男女猛烈xx00免费视频试看 | 少妇无码一区二区二三区 | 99久久久无码国产aaa精品 | 欧美日韩综合一区二区三区 | 丝袜 中出 制服 人妻 美腿 | 最近的中文字幕在线看视频 | 内射白嫩少妇超碰 | 色婷婷综合中文久久一本 | 免费无码一区二区三区蜜桃大 | 曰韩无码二三区中文字幕 | 欧美第一黄网免费网站 | 亚洲综合无码一区二区三区 | 丝袜人妻一区二区三区 | 免费视频欧美无人区码 | 性做久久久久久久免费看 | ass日本丰满熟妇pics | 国产农村乱对白刺激视频 | 欧美日韩一区二区免费视频 | 四十如虎的丰满熟妇啪啪 | 狠狠色噜噜狠狠狠狠7777米奇 | 欧美日本日韩 | 国产精品欧美成人 | 丰满妇女强制高潮18xxxx | 久久97精品久久久久久久不卡 | 亚洲欧美精品aaaaaa片 | 午夜精品久久久久久久久 | 野外少妇愉情中文字幕 | а天堂中文在线官网 | 亚洲色在线无码国产精品不卡 | 国产免费观看黄av片 | 久久亚洲中文字幕无码 | 久久视频在线观看精品 | 欧美变态另类xxxx | 亚洲成色www久久网站 | 人妻少妇精品无码专区二区 | 小鲜肉自慰网站xnxx | 特大黑人娇小亚洲女 | 亚洲人成无码网www | 亚洲另类伦春色综合小说 | 国产午夜精品一区二区三区嫩草 | 国产成人无码区免费内射一片色欲 | 亚洲а∨天堂久久精品2021 | 永久免费观看美女裸体的网站 | 国产后入清纯学生妹 | 黑人粗大猛烈进出高潮视频 | 老头边吃奶边弄进去呻吟 | 精品无码成人片一区二区98 | 荡女精品导航 | 久久久中文久久久无码 | 激情内射亚州一区二区三区爱妻 | 亚洲精品一区二区三区四区五区 | 中文字幕无码视频专区 | 亚洲成a人片在线观看无码 | 亚洲国产精品久久久天堂 | 97人妻精品一区二区三区 | 少妇性俱乐部纵欲狂欢电影 | 蜜桃视频插满18在线观看 | 嫩b人妻精品一区二区三区 | 国产免费久久久久久无码 | 国产人妻大战黑人第1集 | 日产国产精品亚洲系列 | 亚洲熟妇色xxxxx欧美老妇y | 夜夜夜高潮夜夜爽夜夜爰爰 | 久久精品99久久香蕉国产色戒 | 偷窥日本少妇撒尿chinese | 国内丰满熟女出轨videos | 少妇性俱乐部纵欲狂欢电影 | 欧美 日韩 亚洲 在线 | av无码久久久久不卡免费网站 | 午夜免费福利小电影 | 欧美精品一区二区精品久久 | 亚洲熟妇自偷自拍另类 | 亚洲精品国产a久久久久久 | 粗大的内捧猛烈进出视频 | 国产人妻大战黑人第1集 | 天天躁夜夜躁狠狠是什么心态 | 国产免费观看黄av片 | 国产成人综合美国十次 | 久久午夜无码鲁丝片午夜精品 | 在线观看欧美一区二区三区 | 色欲人妻aaaaaaa无码 | 亚洲人成影院在线无码按摩店 | 久久99国产综合精品 | 丰满妇女强制高潮18xxxx | 亚洲熟妇自偷自拍另类 | 久久99国产综合精品 | 国产九九九九九九九a片 | 人妻无码αv中文字幕久久琪琪布 | 清纯唯美经典一区二区 | 成人无码精品一区二区三区 | 国产在线精品一区二区三区直播 | 色偷偷人人澡人人爽人人模 | 欧美性猛交xxxx富婆 | 老熟女重囗味hdxx69 | 国产亚洲精品久久久ai换 | 亚洲国产高清在线观看视频 | 蜜桃视频韩日免费播放 | aa片在线观看视频在线播放 | 精品一区二区不卡无码av | 99精品国产综合久久久久五月天 | 人人妻在人人 | 国产精品亚洲专区无码不卡 | 中文字幕人妻无码一区二区三区 | 无码av岛国片在线播放 | 国产午夜无码视频在线观看 | 亚洲精品成人福利网站 | 一本色道婷婷久久欧美 | 亚洲色在线无码国产精品不卡 | 成人亚洲精品久久久久软件 | 99久久亚洲精品无码毛片 | 欧美真人作爱免费视频 | 性生交大片免费看l | 亚洲欧洲日本无在线码 | 亚洲色偷偷偷综合网 | 精品久久久久久人妻无码中文字幕 | 久久99精品久久久久久动态图 | 人人超人人超碰超国产 | 麻豆国产丝袜白领秘书在线观看 | 免费人成在线视频无码 | 蜜桃无码一区二区三区 | 青青久在线视频免费观看 | 中文精品无码中文字幕无码专区 | 国产人妻人伦精品 | 性欧美videos高清精品 | 久久国产精品偷任你爽任你 | 国产乡下妇女做爰 | 欧美老妇交乱视频在线观看 | 天下第一社区视频www日本 | 亚洲色在线无码国产精品不卡 | 在线看片无码永久免费视频 | 日韩精品无码一本二本三本色 | 国产亚洲美女精品久久久2020 | 国产亚av手机在线观看 | 无码人妻av免费一区二区三区 | 国产人妖乱国产精品人妖 | 一本一道久久综合久久 | 日韩精品无码一区二区中文字幕 | 未满小14洗澡无码视频网站 | 乱码午夜-极国产极内射 | 久久久久免费看成人影片 | 激情内射亚州一区二区三区爱妻 | 久久久国产一区二区三区 | 亚洲精品国偷拍自产在线麻豆 | 欧美高清在线精品一区 | 久久久久亚洲精品中文字幕 | 欧美肥老太牲交大战 | 精品久久综合1区2区3区激情 | 丁香啪啪综合成人亚洲 | 人妻少妇精品无码专区动漫 | 内射欧美老妇wbb | 乱人伦中文视频在线观看 | a在线亚洲男人的天堂 | 精品国偷自产在线视频 | 国产精品无码mv在线观看 | 一本大道久久东京热无码av | av无码电影一区二区三区 | 午夜不卡av免费 一本久久a久久精品vr综合 | 亚洲成在人网站无码天堂 | 四虎4hu永久免费 | 在线天堂新版最新版在线8 | 亚洲男女内射在线播放 | 67194成是人免费无码 | 在线а√天堂中文官网 | 无套内谢的新婚少妇国语播放 | 日韩精品无码一本二本三本色 | 天天躁日日躁狠狠躁免费麻豆 | 激情人妻另类人妻伦 | 精品国产一区二区三区av 性色 | 国内揄拍国内精品少妇国语 | 中文精品久久久久人妻不卡 | 少妇激情av一区二区 | 精品无码国产自产拍在线观看蜜 | 国产超级va在线观看视频 | 国产明星裸体无码xxxx视频 | 狠狠综合久久久久综合网 | 亚洲国产精品无码久久久久高潮 | 亚洲精品综合五月久久小说 | 性色av无码免费一区二区三区 | 国产精品第一区揄拍无码 | 中文字幕 人妻熟女 | 亚洲中文字幕在线观看 | 日日天日日夜日日摸 | 国产农村妇女高潮大叫 | 天干天干啦夜天干天2017 | 国产成人av免费观看 | 啦啦啦www在线观看免费视频 | 精品无码成人片一区二区98 | 日本在线高清不卡免费播放 | 精品国产一区av天美传媒 | 亚洲精品成人福利网站 | 亚洲欧美精品aaaaaa片 | 成人无码精品一区二区三区 | 亚洲国产欧美日韩精品一区二区三区 | 国产超碰人人爽人人做人人添 | 麻豆成人精品国产免费 | 少妇无码一区二区二三区 | 一本大道伊人av久久综合 | 樱花草在线播放免费中文 | 久久精品国产99久久6动漫 | 久久99精品国产.久久久久 | 久在线观看福利视频 | 久久亚洲a片com人成 | 日韩精品一区二区av在线 | 高潮毛片无遮挡高清免费 | 亚洲熟悉妇女xxx妇女av | 亚洲色欲色欲天天天www | 久久综合给合久久狠狠狠97色 | 人妻人人添人妻人人爱 | 红桃av一区二区三区在线无码av | a在线观看免费网站大全 | 少妇被黑人到高潮喷出白浆 | 亚洲 欧美 激情 小说 另类 | 熟妇女人妻丰满少妇中文字幕 | 亚洲国产高清在线观看视频 | 人妻插b视频一区二区三区 | 亚洲娇小与黑人巨大交 | 日韩少妇内射免费播放 | 帮老师解开蕾丝奶罩吸乳网站 | 乱码av麻豆丝袜熟女系列 | 正在播放老肥熟妇露脸 | 色欲久久久天天天综合网精品 | 午夜精品久久久内射近拍高清 | 亚洲啪av永久无码精品放毛片 | 亚洲中文字幕在线无码一区二区 | 99精品视频在线观看免费 | 国产特级毛片aaaaaa高潮流水 | 国产在热线精品视频 | a在线观看免费网站大全 | 四虎永久在线精品免费网址 | 在线成人www免费观看视频 | 丰满护士巨好爽好大乳 | 精品亚洲韩国一区二区三区 | 福利一区二区三区视频在线观看 | 樱花草在线播放免费中文 | 亚洲精品久久久久avwww潮水 | 国产精品-区区久久久狼 | 蜜臀aⅴ国产精品久久久国产老师 | а天堂中文在线官网 | 久久久久久av无码免费看大片 | 老熟妇仑乱视频一区二区 | 精品国产一区二区三区四区 | 国产av无码专区亚洲a∨毛片 | 亚洲人亚洲人成电影网站色 | 国产精品美女久久久久av爽李琼 | 在线看片无码永久免费视频 | 1000部夫妻午夜免费 | 国内综合精品午夜久久资源 | 在教室伦流澡到高潮hnp视频 | 人妻少妇精品无码专区二区 | 亚洲a无码综合a国产av中文 | 国产后入清纯学生妹 | 动漫av网站免费观看 | 亚洲精品久久久久久久久久久 | 无码福利日韩神码福利片 | 激情内射亚州一区二区三区爱妻 | 国产热a欧美热a在线视频 | 国产美女精品一区二区三区 | 大肉大捧一进一出视频出来呀 | 亚洲欧洲日本综合aⅴ在线 | 天堂无码人妻精品一区二区三区 | 成人欧美一区二区三区 | 中文字幕+乱码+中文字幕一区 | 亚洲日韩乱码中文无码蜜桃臀网站 | 国产成人无码专区 | 狂野欧美性猛xxxx乱大交 | 色综合久久中文娱乐网 | 粉嫩少妇内射浓精videos | 麻豆国产丝袜白领秘书在线观看 | 1000部夫妻午夜免费 | 波多野结衣乳巨码无在线观看 | 在线观看国产午夜福利片 | 久久久婷婷五月亚洲97号色 | 亚洲精品一区二区三区在线 | 无码一区二区三区在线观看 | 中文字幕乱码人妻二区三区 | 国产精品无套呻吟在线 | 欧美freesex黑人又粗又大 | 精品国产一区二区三区av 性色 | 国产精品美女久久久网av | 亚洲色大成网站www国产 | 国产 浪潮av性色四虎 | 亚洲の无码国产の无码影院 | 日本熟妇大屁股人妻 | 日本一区二区更新不卡 | 大胆欧美熟妇xx | 无码av岛国片在线播放 | 亚洲熟女一区二区三区 | 久久精品国产大片免费观看 | 久久99精品国产.久久久久 | 天干天干啦夜天干天2017 | 国产精品a成v人在线播放 | 自拍偷自拍亚洲精品被多人伦好爽 | 亚洲日韩av一区二区三区中文 | 亚洲精品www久久久 | 成人毛片一区二区 | 日产国产精品亚洲系列 | 西西人体www44rt大胆高清 | 成人av无码一区二区三区 | 久久精品视频在线看15 | 久久人人爽人人人人片 | 国产精品成人av在线观看 | 搡女人真爽免费视频大全 | 日本丰满熟妇videos | 国产国语老龄妇女a片 | 日本肉体xxxx裸交 | 亚洲男人av香蕉爽爽爽爽 | 四虎影视成人永久免费观看视频 | 亚洲欧美日韩国产精品一区二区 | 亚洲中文字幕在线无码一区二区 | 秋霞成人午夜鲁丝一区二区三区 | 日韩欧美中文字幕公布 | 综合网日日天干夜夜久久 | 黑森林福利视频导航 | 国产成人精品一区二区在线小狼 | 天天av天天av天天透 | 亚洲s色大片在线观看 | 欧美日韩人成综合在线播放 | 国产日产欧产精品精品app | 亚洲精品久久久久久一区二区 | 对白脏话肉麻粗话av | 久久久久久av无码免费看大片 | 成熟妇人a片免费看网站 | 亚洲色偷偷男人的天堂 | 18黄暴禁片在线观看 | 亚洲精品美女久久久久久久 | 成熟人妻av无码专区 | 午夜不卡av免费 一本久久a久久精品vr综合 | 国产99久久精品一区二区 | 色五月丁香五月综合五月 | 麻豆md0077饥渴少妇 | 国内丰满熟女出轨videos | 精品久久久无码人妻字幂 | 人妻尝试又大又粗久久 | 亚洲成av人综合在线观看 | 强奷人妻日本中文字幕 | 波多野结衣高清一区二区三区 | 午夜不卡av免费 一本久久a久久精品vr综合 | 俺去俺来也在线www色官网 | 狠狠亚洲超碰狼人久久 | 亚洲第一无码av无码专区 | 亚洲人成网站色7799 | 国产在线精品一区二区三区直播 | 国产美女极度色诱视频www | 中文久久乱码一区二区 | 日本一卡2卡3卡4卡无卡免费网站 国产一区二区三区影院 | 欧美激情一区二区三区成人 | 亚洲精品鲁一鲁一区二区三区 | 国精品人妻无码一区二区三区蜜柚 | 无码人妻丰满熟妇区五十路百度 | 奇米影视7777久久精品人人爽 | 未满成年国产在线观看 | 午夜男女很黄的视频 | 免费无码av一区二区 | 国产熟妇另类久久久久 | 亚洲理论电影在线观看 | 午夜成人1000部免费视频 | 亚洲熟女一区二区三区 | 亚洲色欲久久久综合网东京热 | 无码av最新清无码专区吞精 | 精品无码国产一区二区三区av | 久久精品国产精品国产精品污 | 国产熟女一区二区三区四区五区 | 蜜桃臀无码内射一区二区三区 | 久久久久成人片免费观看蜜芽 | 亚洲男人av天堂午夜在 | 午夜福利试看120秒体验区 | 国产综合久久久久鬼色 | 久久午夜无码鲁丝片午夜精品 | a片免费视频在线观看 | 国产精品亚洲一区二区三区喷水 | 成人免费视频一区二区 | 久久www免费人成人片 | 久久国产精品偷任你爽任你 | 2020最新国产自产精品 | 亚洲国产精品一区二区美利坚 | 精品国产乱码久久久久乱码 | 一本精品99久久精品77 | 国产香蕉尹人视频在线 | 永久免费观看美女裸体的网站 | 精品国产国产综合精品 | 亚洲自偷自偷在线制服 | 内射后入在线观看一区 | 日韩无码专区 | 国产深夜福利视频在线 | 男人扒开女人内裤强吻桶进去 | 日产国产精品亚洲系列 | 国产精品亚洲一区二区三区喷水 | 日本饥渴人妻欲求不满 | 亚洲中文字幕无码一久久区 | 欧美丰满少妇xxxx性 | 免费无码的av片在线观看 | 精品国产一区二区三区av 性色 | 亚洲一区二区三区播放 | 亚洲第一无码av无码专区 | 中文亚洲成a人片在线观看 | 黑森林福利视频导航 | 3d动漫精品啪啪一区二区中 | 巨爆乳无码视频在线观看 | 无码国模国产在线观看 | 久久国产精品偷任你爽任你 | 精品久久久无码中文字幕 | 玩弄中年熟妇正在播放 | 无码av免费一区二区三区试看 | 天天躁夜夜躁狠狠是什么心态 | 嫩b人妻精品一区二区三区 | 国产99久久精品一区二区 | 成人无码视频免费播放 | 一本无码人妻在中文字幕免费 | 精品国产青草久久久久福利 | 国产午夜精品一区二区三区嫩草 | 日日天日日夜日日摸 | 亚洲最大成人网站 | 色欲综合久久中文字幕网 | aⅴ在线视频男人的天堂 | 99精品视频在线观看免费 | 婷婷丁香五月天综合东京热 | 久久久国产一区二区三区 | 成人aaa片一区国产精品 | 久久午夜夜伦鲁鲁片无码免费 | 国产精品无码永久免费888 | 领导边摸边吃奶边做爽在线观看 | 欧美freesex黑人又粗又大 | 伊人久久大香线蕉av一区二区 | 国产精品久久久久久无码 | 日韩在线不卡免费视频一区 | 四十如虎的丰满熟妇啪啪 | 一本大道伊人av久久综合 | 精品人妻中文字幕有码在线 | 国産精品久久久久久久 | 天堂а√在线地址中文在线 | 久久久中文字幕日本无吗 | 久久午夜无码鲁丝片秋霞 | 成人试看120秒体验区 | 国产精品资源一区二区 | 在线观看国产一区二区三区 | 成人精品视频一区二区三区尤物 | 亚洲色成人中文字幕网站 | 任你躁国产自任一区二区三区 | 国产人妖乱国产精品人妖 | 永久免费观看国产裸体美女 | 日韩欧美中文字幕在线三区 | 99精品视频在线观看免费 | 国产后入清纯学生妹 | 欧洲精品码一区二区三区免费看 | 5858s亚洲色大成网站www | 波多野结衣乳巨码无在线观看 | 未满成年国产在线观看 | 精品久久久久久人妻无码中文字幕 | 日韩精品久久久肉伦网站 | 国产超碰人人爽人人做人人添 | 精品一区二区三区波多野结衣 | 色婷婷久久一区二区三区麻豆 | 永久免费精品精品永久-夜色 | 国产精品对白交换视频 | 午夜免费福利小电影 | 久久人人爽人人爽人人片ⅴ | 色窝窝无码一区二区三区色欲 | 亚洲精品无码人妻无码 | 动漫av一区二区在线观看 | 国产真实乱对白精彩久久 | 少妇愉情理伦片bd | 国产成人无码专区 | 日日摸天天摸爽爽狠狠97 | 久久99精品国产麻豆蜜芽 | 国产小呦泬泬99精品 | 亚欧洲精品在线视频免费观看 | 无码精品人妻一区二区三区av | 国产偷抇久久精品a片69 | 久久国产劲爆∧v内射 | 乱码午夜-极国产极内射 | 日韩精品无码免费一区二区三区 | 老熟女乱子伦 | 男女性色大片免费网站 | 无码av免费一区二区三区试看 | 永久免费精品精品永久-夜色 | 无码人妻av免费一区二区三区 | 国产内射爽爽大片视频社区在线 | 亚欧洲精品在线视频免费观看 | 国产真实乱对白精彩久久 | 欧美日韩在线亚洲综合国产人 | 亚洲一区二区三区 | 久久五月精品中文字幕 | 一本色道婷婷久久欧美 | 国产精品久久久 | 少妇愉情理伦片bd | 久久精品视频在线看15 | 伊在人天堂亚洲香蕉精品区 | 成人一区二区免费视频 | 中文字幕无码日韩欧毛 | 亚洲码国产精品高潮在线 | 亚洲va欧美va天堂v国产综合 | 骚片av蜜桃精品一区 | 在线а√天堂中文官网 | 人人爽人人爽人人片av亚洲 | 亚洲日本一区二区三区在线 | 最近免费中文字幕中文高清百度 | 国产精品无码一区二区桃花视频 | 东京无码熟妇人妻av在线网址 | 扒开双腿吃奶呻吟做受视频 | 久久熟妇人妻午夜寂寞影院 | 午夜福利不卡在线视频 | 日韩精品成人一区二区三区 | 欧美变态另类xxxx | 无码av中文字幕免费放 | 成年美女黄网站色大免费视频 | 色一情一乱一伦一视频免费看 | 国产黄在线观看免费观看不卡 | 亚洲中文字幕在线观看 | 最新版天堂资源中文官网 | 毛片内射-百度 | 激情内射日本一区二区三区 | 午夜男女很黄的视频 | 黑人粗大猛烈进出高潮视频 | 亚洲另类伦春色综合小说 | 免费国产成人高清在线观看网站 | 国产乱码精品一品二品 | 久久人人爽人人爽人人片av高清 | 欧美成人家庭影院 | 精品无码成人片一区二区98 | 99精品国产综合久久久久五月天 | 国产成人无码午夜视频在线观看 | аⅴ资源天堂资源库在线 | 啦啦啦www在线观看免费视频 | 精品无码国产一区二区三区av | 精品一区二区三区无码免费视频 | 麻豆国产丝袜白领秘书在线观看 | 色婷婷综合激情综在线播放 | 国产另类ts人妖一区二区 | 日本精品人妻无码77777 天堂一区人妻无码 | 国产精品久久久一区二区三区 | 精品国产成人一区二区三区 | 377p欧洲日本亚洲大胆 | av无码不卡在线观看免费 | 麻豆国产人妻欲求不满谁演的 | 天天爽夜夜爽夜夜爽 | 日本护士xxxxhd少妇 | 色综合久久久久综合一本到桃花网 | 在教室伦流澡到高潮hnp视频 | 特黄特色大片免费播放器图片 | 国产性猛交╳xxx乱大交 国产精品久久久久久无码 欧洲欧美人成视频在线 | 亚洲精品国产精品乱码视色 | 日本一本二本三区免费 | 精品国产麻豆免费人成网站 | 欧美老妇交乱视频在线观看 | 久久精品国产大片免费观看 | 四虎影视成人永久免费观看视频 | 一本加勒比波多野结衣 | 亚洲精品一区二区三区在线 | 亚洲国产精品久久久久久 | 男人和女人高潮免费网站 | 国产高清不卡无码视频 | 人人澡人人透人人爽 | 国产乱人伦偷精品视频 | 亚洲 欧美 激情 小说 另类 | 人妻插b视频一区二区三区 | 乱人伦人妻中文字幕无码 | 亚洲人亚洲人成电影网站色 | 欧美精品免费观看二区 | 久久综合激激的五月天 | 4hu四虎永久在线观看 | 亚洲欧洲无卡二区视頻 | 国产成人精品必看 | 亚洲成色www久久网站 | 亚洲国产精品无码一区二区三区 | 亚洲成在人网站无码天堂 | 国产三级久久久精品麻豆三级 | 午夜精品久久久内射近拍高清 | 国产农村妇女aaaaa视频 撕开奶罩揉吮奶头视频 | 色五月五月丁香亚洲综合网 | 久久无码中文字幕免费影院蜜桃 | 日韩欧美中文字幕公布 | 亚洲中文字幕无码中文字在线 | 夜夜高潮次次欢爽av女 | 亚洲爆乳精品无码一区二区三区 | 中文字幕日产无线码一区 | 99国产欧美久久久精品 | 野狼第一精品社区 | 人妻无码αv中文字幕久久琪琪布 | 亚洲国产精华液网站w | 天天躁日日躁狠狠躁免费麻豆 | 亚洲欧美精品aaaaaa片 | 欧美丰满老熟妇xxxxx性 | 国产av久久久久精东av | 一本无码人妻在中文字幕免费 | 精品国产青草久久久久福利 | 亚洲综合另类小说色区 | 377p欧洲日本亚洲大胆 | 强奷人妻日本中文字幕 | 一区二区三区乱码在线 | 欧洲 | 乌克兰少妇xxxx做受 | 麻豆蜜桃av蜜臀av色欲av | 天天拍夜夜添久久精品 | 东京热男人av天堂 | 国产真人无遮挡作爱免费视频 | 亚洲aⅴ无码成人网站国产app | 国产亚洲视频中文字幕97精品 | 中文精品久久久久人妻不卡 | 国语精品一区二区三区 | 婷婷五月综合缴情在线视频 | 日韩在线不卡免费视频一区 | 日韩av无码一区二区三区不卡 | 波多野42部无码喷潮在线 | 日日天日日夜日日摸 | 欧美乱妇无乱码大黄a片 | 婷婷色婷婷开心五月四房播播 | 中文字幕无码日韩欧毛 | 久久zyz资源站无码中文动漫 | 小鲜肉自慰网站xnxx | 天海翼激烈高潮到腰振不止 | 初尝人妻少妇中文字幕 | 久久久久成人精品免费播放动漫 | 少妇激情av一区二区 | 亚洲成色www久久网站 | 日韩精品乱码av一区二区 | 大肉大捧一进一出好爽视频 | 九月婷婷人人澡人人添人人爽 | 人妻少妇精品无码专区动漫 | 色偷偷av老熟女 久久精品人妻少妇一区二区三区 | 亚洲乱码日产精品bd | 99久久人妻精品免费一区 | 97精品人妻一区二区三区香蕉 | 夜夜高潮次次欢爽av女 | 啦啦啦www在线观看免费视频 | 国产精品多人p群无码 | 成在人线av无码免观看麻豆 | 亚洲国产精品美女久久久久 | 极品尤物被啪到呻吟喷水 | 国产又粗又硬又大爽黄老大爷视 | 国产人妻人伦精品1国产丝袜 | 特级做a爰片毛片免费69 | 欧美熟妇另类久久久久久多毛 | 欧美人与禽猛交狂配 | 2020最新国产自产精品 | 久久午夜无码鲁丝片午夜精品 | 天干天干啦夜天干天2017 | 午夜丰满少妇性开放视频 | 国产精品高潮呻吟av久久4虎 | 欧美日韩色另类综合 | 啦啦啦www在线观看免费视频 | 又大又硬又爽免费视频 | 国产又爽又猛又粗的视频a片 | 亚洲狠狠婷婷综合久久 | 性啪啪chinese东北女人 | 亚洲一区二区三区国产精华液 | 亚洲欧美色中文字幕在线 | 午夜无码区在线观看 | 国内少妇偷人精品视频 | 在线播放亚洲第一字幕 | 久久综合久久自在自线精品自 | 日本丰满熟妇videos | 亚洲成av人片在线观看无码不卡 | 少妇性l交大片 | 丰满少妇弄高潮了www | 日本免费一区二区三区最新 | а√资源新版在线天堂 | 精品一二三区久久aaa片 | 日日天日日夜日日摸 | 日本一区二区三区免费高清 | 伊人久久大香线蕉av一区二区 | 在线观看国产一区二区三区 | 综合激情五月综合激情五月激情1 | 88国产精品欧美一区二区三区 | 国产卡一卡二卡三 | 亚洲国产精品成人久久蜜臀 | 成人一在线视频日韩国产 | 久精品国产欧美亚洲色aⅴ大片 | 亚洲日本在线电影 | 国产亚洲精品久久久久久久久动漫 | 乱码av麻豆丝袜熟女系列 | 国产精品a成v人在线播放 | 久久精品国产大片免费观看 | 扒开双腿吃奶呻吟做受视频 | 乱人伦中文视频在线观看 | 亚洲a无码综合a国产av中文 | 曰本女人与公拘交酡免费视频 | 国产成人无码一二三区视频 | 日韩人妻无码一区二区三区久久99 | 精品人妻人人做人人爽夜夜爽 | 精品水蜜桃久久久久久久 | 亚洲乱码国产乱码精品精 | 国产精品久久久av久久久 | 天天摸天天透天天添 | 欧美乱妇无乱码大黄a片 | 亚洲自偷自拍另类第1页 | 亚洲小说春色综合另类 | 精品国产国产综合精品 | 一区二区三区乱码在线 | 欧洲 | 窝窝午夜理论片影院 | 国产手机在线αⅴ片无码观看 | 51国偷自产一区二区三区 | 性欧美熟妇videofreesex | 婷婷五月综合激情中文字幕 | 色五月丁香五月综合五月 | 麻豆精产国品 | 午夜嘿嘿嘿影院 | 亚洲爆乳大丰满无码专区 | 国产无套内射久久久国产 | 欧美丰满熟妇xxxx | 西西人体www44rt大胆高清 | 久久亚洲日韩精品一区二区三区 | 日本xxxx色视频在线观看免费 | 国产精品亚洲一区二区三区喷水 | 正在播放老肥熟妇露脸 | 亚洲毛片av日韩av无码 | 国产婷婷色一区二区三区在线 | 久久久久久亚洲精品a片成人 | 狠狠色欧美亚洲狠狠色www | 久久亚洲中文字幕无码 | 国产成人一区二区三区别 | 国产精品久久久久无码av色戒 | 欧美老熟妇乱xxxxx | 久久国产精品二国产精品 | 久久综合给久久狠狠97色 | 亚欧洲精品在线视频免费观看 | 青青草原综合久久大伊人精品 | 国产精品无码一区二区桃花视频 | 无码人妻久久一区二区三区不卡 | 国产精品无套呻吟在线 | 色欲久久久天天天综合网精品 | 5858s亚洲色大成网站www | 欧美日韩一区二区综合 | 少妇愉情理伦片bd | 无码纯肉视频在线观看 | 夜精品a片一区二区三区无码白浆 | 日本一卡2卡3卡4卡无卡免费网站 国产一区二区三区影院 | 亚洲综合色区中文字幕 | 色婷婷欧美在线播放内射 | 狠狠噜狠狠狠狠丁香五月 | 一个人免费观看的www视频 | 人妻少妇精品无码专区动漫 | 亚洲色欲色欲天天天www | 精品一区二区不卡无码av | 网友自拍区视频精品 | 色婷婷欧美在线播放内射 | 乱人伦人妻中文字幕无码久久网 | 中文字幕无码av激情不卡 | 人人澡人人妻人人爽人人蜜桃 | 97久久精品无码一区二区 | 国产成人精品久久亚洲高清不卡 | 无码av免费一区二区三区试看 | 国产成人精品必看 | 成 人 免费观看网站 | 国产精品无码mv在线观看 | 日本大乳高潮视频在线观看 | 乱人伦人妻中文字幕无码久久网 | 国产精品久久久久9999小说 | 国产内射爽爽大片视频社区在线 | 老头边吃奶边弄进去呻吟 | 亚洲男人av香蕉爽爽爽爽 | 亚洲精品国产精品乱码视色 | 亚洲精品国产第一综合99久久 | 熟女少妇人妻中文字幕 | 亚洲国产精品久久人人爱 | 一本久道高清无码视频 | 免费观看又污又黄的网站 | 天下第一社区视频www日本 | 高清不卡一区二区三区 | 天堂а√在线中文在线 | 双乳奶水饱满少妇呻吟 | 久久久无码中文字幕久... | 欧洲vodafone精品性 | 国产亚洲人成a在线v网站 | 少妇厨房愉情理9仑片视频 | 中文字幕无码人妻少妇免费 | av香港经典三级级 在线 | 377p欧洲日本亚洲大胆 | 国产超碰人人爽人人做人人添 | 免费看男女做好爽好硬视频 | 久久人人爽人人人人片 | 老熟女乱子伦 | 精品国产精品久久一区免费式 | 亚洲精品国产精品乱码不卡 | 成人精品天堂一区二区三区 | 久久aⅴ免费观看 | 少妇无码av无码专区在线观看 | 亚洲精品成人福利网站 | 丰满人妻被黑人猛烈进入 | 日日噜噜噜噜夜夜爽亚洲精品 | 999久久久国产精品消防器材 | 日欧一片内射va在线影院 | 国产熟妇高潮叫床视频播放 | 97久久国产亚洲精品超碰热 | 人妻有码中文字幕在线 | 国产精品毛多多水多 | 97色伦图片97综合影院 | 免费看少妇作爱视频 | 欧美真人作爱免费视频 | 中文精品久久久久人妻不卡 | 日韩少妇内射免费播放 | 国产精品无码成人午夜电影 | 成在人线av无码免观看麻豆 | 成人无码影片精品久久久 | 无码人妻av免费一区二区三区 | 自拍偷自拍亚洲精品被多人伦好爽 | 乱码午夜-极国产极内射 | 伦伦影院午夜理论片 | 高清无码午夜福利视频 | 国产在线无码精品电影网 | 极品尤物被啪到呻吟喷水 | 特级做a爰片毛片免费69 | 国产麻豆精品一区二区三区v视界 | 日日摸夜夜摸狠狠摸婷婷 | 无遮无挡爽爽免费视频 | 久久久亚洲欧洲日产国码αv | 婷婷综合久久中文字幕蜜桃三电影 | 熟女体下毛毛黑森林 | 特级做a爰片毛片免费69 | 老熟妇仑乱视频一区二区 | 少妇被黑人到高潮喷出白浆 | 国产精品va在线观看无码 | 日本精品人妻无码77777 天堂一区人妻无码 | 欧美丰满老熟妇xxxxx性 | 国产精品国产三级国产专播 | 亚洲呦女专区 | 亚洲国产精品无码久久久久高潮 | 夜夜高潮次次欢爽av女 | 麻豆蜜桃av蜜臀av色欲av | 亚洲熟妇自偷自拍另类 | а天堂中文在线官网 | 领导边摸边吃奶边做爽在线观看 | 国产特级毛片aaaaaaa高清 | 免费播放一区二区三区 | 国产精品久久国产三级国 | 激情亚洲一区国产精品 | 99久久久国产精品无码免费 | 免费中文字幕日韩欧美 | 中文精品无码中文字幕无码专区 | 亚洲国产日韩a在线播放 | 国产香蕉97碰碰久久人人 | 欧美激情综合亚洲一二区 | 无码av最新清无码专区吞精 | 无码国产色欲xxxxx视频 | 欧美激情内射喷水高潮 | 午夜福利试看120秒体验区 | 精品国产一区二区三区av 性色 | 小泽玛莉亚一区二区视频在线 | 亚洲 另类 在线 欧美 制服 | 人妻与老人中文字幕 | 蜜臀av无码人妻精品 | 日韩精品无码免费一区二区三区 | 大肉大捧一进一出视频出来呀 | 亚洲人成影院在线无码按摩店 | 日韩精品久久久肉伦网站 | 色欲av亚洲一区无码少妇 | 麻豆国产97在线 | 欧洲 | 对白脏话肉麻粗话av | 国产成人无码a区在线观看视频app | 亚洲人交乣女bbw | 麻豆精产国品 | 成熟人妻av无码专区 | 国产在线无码精品电影网 | 亚洲国产日韩a在线播放 | 久久99精品久久久久久动态图 | 亚洲精品一区二区三区婷婷月 | 18禁黄网站男男禁片免费观看 | 日韩精品a片一区二区三区妖精 | 中文字幕av日韩精品一区二区 | 久久精品一区二区三区四区 | 色窝窝无码一区二区三区色欲 | 噜噜噜亚洲色成人网站 | 午夜免费福利小电影 | 久久人人爽人人爽人人片ⅴ | 76少妇精品导航 | 成人精品视频一区二区三区尤物 | 国产精品久久久久久久影院 | 无码人妻出轨黑人中文字幕 | 亚洲日本va中文字幕 | 天堂久久天堂av色综合 | 亚洲爆乳精品无码一区二区三区 | 亚洲小说春色综合另类 | 久久人人爽人人爽人人片av高清 | 人妻天天爽夜夜爽一区二区 | а天堂中文在线官网 | 国产国语老龄妇女a片 | 亚洲精品中文字幕乱码 | 初尝人妻少妇中文字幕 | 亚洲中文字幕久久无码 | 成人女人看片免费视频放人 | 九九久久精品国产免费看小说 | 中国大陆精品视频xxxx | 少妇无套内谢久久久久 | 精品欧洲av无码一区二区三区 | 夜先锋av资源网站 | 中文字幕久久久久人妻 | 一个人看的www免费视频在线观看 | 国产美女精品一区二区三区 | 日韩精品无码一区二区中文字幕 | 国产在线精品一区二区三区直播 | 精品一区二区三区无码免费视频 | 无码纯肉视频在线观看 | 精品一区二区三区无码免费视频 | 激情五月综合色婷婷一区二区 | 亚洲无人区午夜福利码高清完整版 | 精品国产一区二区三区av 性色 | 精品欧美一区二区三区久久久 | 人人爽人人澡人人人妻 | 高清国产亚洲精品自在久久 | 国产性生交xxxxx无码 | 激情五月综合色婷婷一区二区 | 久久国产自偷自偷免费一区调 | 欧美老人巨大xxxx做受 | 国产av无码专区亚洲a∨毛片 | 无码纯肉视频在线观看 | 高潮毛片无遮挡高清免费视频 | 噜噜噜亚洲色成人网站 | 麻豆果冻传媒2021精品传媒一区下载 | 性色欲情网站iwww九文堂 | av无码电影一区二区三区 | 国产卡一卡二卡三 | 精品亚洲韩国一区二区三区 | 少妇高潮一区二区三区99 | 丰满诱人的人妻3 | 亚拍精品一区二区三区探花 | 日本精品少妇一区二区三区 | 国产电影无码午夜在线播放 | 亚洲色偷偷男人的天堂 | 成人影院yy111111在线观看 | 日日摸天天摸爽爽狠狠97 | 麻豆国产丝袜白领秘书在线观看 | 欧美丰满老熟妇xxxxx性 | 日本一本二本三区免费 | 国产精品久免费的黄网站 | 欧美亚洲日韩国产人成在线播放 | 激情爆乳一区二区三区 | 夫妻免费无码v看片 | 日日鲁鲁鲁夜夜爽爽狠狠 | 日韩精品久久久肉伦网站 | 免费无码的av片在线观看 | ass日本丰满熟妇pics | 97se亚洲精品一区 | 在教室伦流澡到高潮hnp视频 | 国产免费久久精品国产传媒 | 装睡被陌生人摸出水好爽 | 国产在线aaa片一区二区99 | 天天躁日日躁狠狠躁免费麻豆 | 1000部啪啪未满十八勿入下载 | 久久国产精品精品国产色婷婷 | 大肉大捧一进一出好爽视频 | 久久国产36精品色熟妇 | 18禁止看的免费污网站 | 亚洲人成无码网www | 久久精品女人的天堂av | 欧美真人作爱免费视频 | 日本乱偷人妻中文字幕 | 中文字幕精品av一区二区五区 | 亚洲成av人综合在线观看 | 亚洲乱码日产精品bd | 又湿又紧又大又爽a视频国产 | 久久无码人妻影院 | 中文字幕+乱码+中文字幕一区 | 天天av天天av天天透 | 激情国产av做激情国产爱 | 国产成人无码一二三区视频 | 日本饥渴人妻欲求不满 | 日本一本二本三区免费 | 欧美性猛交xxxx富婆 | 成人无码视频在线观看网站 | 亚洲狠狠婷婷综合久久 | 精品日本一区二区三区在线观看 | 亚洲综合无码久久精品综合 | 51国偷自产一区二区三区 | 日本一卡二卡不卡视频查询 | 国产偷国产偷精品高清尤物 | 国内精品久久毛片一区二区 | 国产凸凹视频一区二区 | 亚洲区小说区激情区图片区 | 亚洲日本va午夜在线电影 | 一本无码人妻在中文字幕免费 | 综合激情五月综合激情五月激情1 | 最近的中文字幕在线看视频 | 夜先锋av资源网站 | 成人免费无码大片a毛片 | 中文字幕人成乱码熟女app | 国产xxx69麻豆国语对白 | 久久人人爽人人人人片 | 欧美xxxx黑人又粗又长 | 免费视频欧美无人区码 | 久在线观看福利视频 | 国产人成高清在线视频99最全资源 | 少妇人妻偷人精品无码视频 | 亚洲の无码国产の无码影院 | 熟妇女人妻丰满少妇中文字幕 | 精品欧洲av无码一区二区三区 | 国产精品无套呻吟在线 | 极品嫩模高潮叫床 | 亚洲国产欧美国产综合一区 | 少妇无套内谢久久久久 | 亚洲国产精品无码久久久久高潮 | 伊在人天堂亚洲香蕉精品区 | 伊人久久大香线焦av综合影院 | 久久久久久九九精品久 | 久久99久久99精品中文字幕 | 人人妻人人澡人人爽人人精品 | 正在播放老肥熟妇露脸 | 97精品国产97久久久久久免费 | 婷婷综合久久中文字幕蜜桃三电影 | 成熟妇人a片免费看网站 | 对白脏话肉麻粗话av | 久久婷婷五月综合色国产香蕉 | 中文字幕精品av一区二区五区 | 亚洲熟女一区二区三区 | 中文字幕日产无线码一区 | 久久午夜夜伦鲁鲁片无码免费 | 综合激情五月综合激情五月激情1 | 性做久久久久久久免费看 | 日日摸夜夜摸狠狠摸婷婷 | 老司机亚洲精品影院 | 久久久久99精品国产片 | 无码人妻精品一区二区三区不卡 | 国产成人精品必看 | 熟女俱乐部五十路六十路av | 男人和女人高潮免费网站 | 亚洲第一网站男人都懂 | 日本护士毛茸茸高潮 | 免费观看黄网站 | 久久久久免费看成人影片 | 久久zyz资源站无码中文动漫 | 久久久中文久久久无码 | 老司机亚洲精品影院无码 | 乱人伦中文视频在线观看 | 无码午夜成人1000部免费视频 | 在线看片无码永久免费视频 | 欧美自拍另类欧美综合图片区 | 免费人成网站视频在线观看 | 精品成在人线av无码免费看 | 成熟妇人a片免费看网站 | 欧美熟妇另类久久久久久不卡 | 久久综合给合久久狠狠狠97色 | 国产高清不卡无码视频 | 熟女体下毛毛黑森林 | 一区二区三区乱码在线 | 欧洲 | 2019nv天堂香蕉在线观看 | 精品国产一区av天美传媒 | 午夜精品久久久久久久久 | 亚洲gv猛男gv无码男同 | 亚洲一区二区三区国产精华液 | 国产亚洲tv在线观看 | 国产成人综合在线女婷五月99播放 | 亚洲爆乳无码专区 | 国产无遮挡又黄又爽免费视频 | 亚洲综合精品香蕉久久网 | av人摸人人人澡人人超碰下载 | 成人无码精品1区2区3区免费看 | 亚洲成av人影院在线观看 | 欧美黑人乱大交 | 97久久精品无码一区二区 | 婷婷六月久久综合丁香 | 人妻插b视频一区二区三区 | 色欲av亚洲一区无码少妇 | 给我免费的视频在线观看 | 内射巨臀欧美在线视频 | 在线观看国产一区二区三区 | 亚洲精品成a人在线观看 | 伊在人天堂亚洲香蕉精品区 | 熟女俱乐部五十路六十路av | 四虎影视成人永久免费观看视频 | 欧洲极品少妇 | 狠狠cao日日穞夜夜穞av | 欧美熟妇另类久久久久久不卡 | 国产亚av手机在线观看 | 波多野结衣乳巨码无在线观看 | 亚洲国产精品无码久久久久高潮 | 国产精品免费大片 | 国产精品久久久一区二区三区 | 蜜臀av在线观看 在线欧美精品一区二区三区 | 亚洲色大成网站www | 色窝窝无码一区二区三区色欲 | 久青草影院在线观看国产 | 国产av人人夜夜澡人人爽麻豆 | 国产午夜亚洲精品不卡 | 精品 日韩 国产 欧美 视频 | 久久国产劲爆∧v内射 | 永久免费观看美女裸体的网站 | 亚洲热妇无码av在线播放 | 日韩人妻无码一区二区三区久久99 | а天堂中文在线官网 | 久久综合色之久久综合 | 97久久超碰中文字幕 | 亚洲天堂2017无码中文 | 国产精品亚洲lv粉色 | 久久久www成人免费毛片 | 亚洲精品综合一区二区三区在线 | 国产莉萝无码av在线播放 | 一本久久伊人热热精品中文字幕 | 亚洲一区二区三区偷拍女厕 | 亚洲a无码综合a国产av中文 | 亚洲精品一区二区三区四区五区 | 无套内谢的新婚少妇国语播放 | 亚洲精品国产第一综合99久久 | 欧美国产亚洲日韩在线二区 | 亚洲国产精品久久人人爱 | 亚洲精品成人福利网站 | 一本久道高清无码视频 | 亚洲日本va午夜在线电影 | 国产无遮挡吃胸膜奶免费看 | 亚洲综合精品香蕉久久网 | 成人欧美一区二区三区黑人免费 | 又大又硬又爽免费视频 | 欧美刺激性大交 | 亚洲国产精华液网站w | 国产亚洲日韩欧美另类第八页 | 无码午夜成人1000部免费视频 | 欧洲熟妇精品视频 | 无码av免费一区二区三区试看 | 成人三级无码视频在线观看 | 国产免费久久久久久无码 | 性做久久久久久久免费看 | 亚洲最大成人网站 | 国产色精品久久人妻 | 日日橹狠狠爱欧美视频 | 99精品国产综合久久久久五月天 | 日本免费一区二区三区最新 | 亚洲精品久久久久avwww潮水 | 色欲av亚洲一区无码少妇 | 欧美日韩亚洲国产精品 | 男女猛烈xx00免费视频试看 | 7777奇米四色成人眼影 | 国产精品久久久久无码av色戒 | 性做久久久久久久久 | 精品无码国产一区二区三区av | 大肉大捧一进一出好爽视频 | 亚洲狠狠婷婷综合久久 | 荫蒂被男人添的好舒服爽免费视频 | 免费观看激色视频网站 | 精品少妇爆乳无码av无码专区 | 国产精品视频免费播放 | 亚洲日本一区二区三区在线 | 国产精品久久久久9999小说 | 无码人妻丰满熟妇区毛片18 | 亚洲七七久久桃花影院 | 中文精品无码中文字幕无码专区 | 夜夜夜高潮夜夜爽夜夜爰爰 | 日本肉体xxxx裸交 | 日韩精品无码免费一区二区三区 | 日本大乳高潮视频在线观看 | 野外少妇愉情中文字幕 | 97资源共享在线视频 | 爱做久久久久久 | 无码人妻少妇伦在线电影 | 无遮挡啪啪摇乳动态图 | 亚洲の无码国产の无码步美 | 亚洲国产欧美日韩精品一区二区三区 | 伊人久久大香线焦av综合影院 | 精品偷自拍另类在线观看 | 少妇高潮喷潮久久久影院 | 欧美高清在线精品一区 | 东京无码熟妇人妻av在线网址 | 国产亚洲精品精品国产亚洲综合 | 好男人www社区 | 亚洲a无码综合a国产av中文 | 国产片av国语在线观看 | 麻豆人妻少妇精品无码专区 | 成人免费视频一区二区 | 亚洲区欧美区综合区自拍区 | 国产精品人人爽人人做我的可爱 | 最新国产乱人伦偷精品免费网站 | 日本高清一区免费中文视频 | 日本一卡二卡不卡视频查询 | 免费无码午夜福利片69 | 国产精品va在线播放 | 日本一区二区更新不卡 | 国产真人无遮挡作爱免费视频 | 女人被爽到呻吟gif动态图视看 | 久久97精品久久久久久久不卡 | 久久综合网欧美色妞网 | 5858s亚洲色大成网站www | 日韩少妇白浆无码系列 | 欧美日本日韩 | 又大又硬又黄的免费视频 | 荫蒂被男人添的好舒服爽免费视频 | 亚洲第一无码av无码专区 | 久久精品国产大片免费观看 | 久久精品人妻少妇一区二区三区 | 久久久久免费精品国产 | 无码人妻精品一区二区三区不卡 | 久久综合久久自在自线精品自 | 永久免费精品精品永久-夜色 | 国产精品无码永久免费888 | 亚洲精品一区二区三区婷婷月 | 蜜臀av在线观看 在线欧美精品一区二区三区 | 国产va免费精品观看 | 国产亚洲日韩欧美另类第八页 | 亚洲一区二区三区播放 | 欧美日本精品一区二区三区 | 久久成人a毛片免费观看网站 | 又大又黄又粗又爽的免费视频 | 999久久久国产精品消防器材 | 欧美成人家庭影院 | 欧美人与牲动交xxxx | 亚洲成熟女人毛毛耸耸多 | 在线观看免费人成视频 | 精品国产成人一区二区三区 | 国产97在线 | 亚洲 | 中文字幕+乱码+中文字幕一区 | 51国偷自产一区二区三区 | 亚洲欧美中文字幕5发布 | 国产免费无码一区二区视频 | 少妇被黑人到高潮喷出白浆 | 亚洲国产av精品一区二区蜜芽 | 国产亚洲精品精品国产亚洲综合 | 99精品国产综合久久久久五月天 | 国产精品久免费的黄网站 | 玩弄人妻少妇500系列视频 | 又粗又大又硬又长又爽 | 任你躁国产自任一区二区三区 | 扒开双腿吃奶呻吟做受视频 | 国产真实乱对白精彩久久 | 草草网站影院白丝内射 | 中文字幕乱码亚洲无线三区 | 国产sm调教视频在线观看 | 中文字幕日产无线码一区 | 久久久久国色av免费观看性色 | 色综合久久久无码中文字幕 | 成人av无码一区二区三区 | a国产一区二区免费入口 | 国产日产欧产精品精品app | 夜先锋av资源网站 | 日韩精品一区二区av在线 | 亚洲国产精品一区二区第一页 | 中文字幕无码乱人伦 | 久久国内精品自在自线 | 国产精品第一区揄拍无码 | 国产va免费精品观看 | 久久国产劲爆∧v内射 | 免费无码一区二区三区蜜桃大 |