英语学习笔记2019-10-25

英语学习笔记2019-10-25

We should try to know more about the dynamics of the computer industry so that we can choose a better direction to go according to our actual conditions. The more we know, the better we will be. In recent years, Python has been more and more popular with the rise of big data, artificial intelligence and cloud computing, so it's necessary to know more about Python.

I. Python Learning Directions

  1. Python – Data Structure & Algorithm (internal strength)
  2. Python – Web Development (Django, Flask, Tornado...)
  3. Python – Crawler (requests, BeautifulSoup, XPath, pandas...)
  4. Python – Hacker Technology
  5. Python – Data Analysis – Data Mining -- KDD: Knowledge Discovery in Database
  6. Python – AI (Artificial Intelligence) – Machine Learning – Deep Learning (TensorFlow, PyTorch, Keras, ….)

https://runestone.academy/runestone/books/published/pythonds/index.html

Here I recommend an online Python editor to you. 

You can access the website on your PC or smartphone.

http://www.dooccn.com/python3/

In-class Exercise: Write a Python program to evaluate the sum of 1, 2, 3, ...., and 100.

II. Local Python Development Environment

Last time we installed Anaconda 3 on the computer.

Now let's take a look at the start menu for Anaconda 3.

1. Anaconda Prompt

Let’s start Anaconda Prompt and we will see a window like this:

(1) Start Python

Type "python" after the Anaconda prompt > and then press Enter to enter the Python environment.

Now we can type a Python statement to print a message on the screen.

Type print("Welcome to Python World~") after the >>> prompt and Press Enter to execute the statement.

print() function is used to output some data on the screen.

Now let me demonstrate how to do addition by writing several Python statements.

No. 1 statement: assign 100 to the varible a, then a must be an int variable

No.2 statement: assign 200 to the variable b, then b must b an int variable

No.3 statement: assign the sum of a and b to the variable sum, then sum must be an int variable

No.4 statement: output the result by calling the print() function

No.1 and No.2 statements belong to the input part;

No. 3 statement belongs to the processing part;

No. 4 statement belongs to the output part.

We can use the type() function to get the type of a variable or an expression.

The result of an int data plus a float data will be of float type.

Can addition be performed on an int data and a str data?

There are several ways to solve the problem.

Method 1.  use the conversion function str()

Method 2.  use the type specifier %d to output int data

Method 3. use the format() function to output data in a specified format

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

howard2005

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值