Book Imformation :

<Pratical Programming : An Introduction to Computer Science Using Python 3> 2nd Edtion

Author : Paul Gries,Jennifer Campbell,Jason Montojo

Page : Chapter 1 and Chapter 2.1-2.2

1.every computer runs operating system,which it's the only program on the computer that's allowed direct access to the hardware(硬件).

or more complicate(add another layer between the programmer and the hardware) :

2.two ways to use the Python interpreter(解释器) :

(1).execute a saved Python program with .py extension(扩展,后缀)

(2).using a Python shell(壳,命令解析器)

3.the >>> symbol is called a prompt(提示),prompting you to type something

4.the result of interger division has a decimal point even is a whole number :

 >>> 5 / 2
2.5
>>> 4 / 2
2.0

5.when the operands (操作数) are int and float,Python automatically convert the int into a float :

 >>> 17.0 - 10
7.0
>>> 17 - 10.0
7.0

and you can omit zero like ‘17.’ (but most people think it is a bad idea)

6.integer division,modulo(取模)

 >>> 53 // 24
2
>>> 53 % 24
5

//:整除

when the operands are negative or float,it takes the floor(向下取整) of the result.

 >>> -17 // 10
-2
>>> 17 // 10
1
 >>> 3.5 // 1.0
3.0
>>> 3 // 1.1
2.0
>>> 3.3 // 1
3.0

when using modulo,the sign of the result matches the divisor(除数)

定义:a % b = a - n*b,n为不超过a/b的整数

 >>> -17 % 10
3
>>> 17 % -10
-3

7.exponentiation(取幂):**

 >>> 2 ** 3
8
>>> 3 ** 3
27

8.binary operators(双目运算符),unary operators(单目运算符)

+、-、*、/:binary operators

-(nagetive):unary operators

 >>> -5
-5
>>> --5
5
>>> ---5
-5

Note 1 for <Pratical Programming : An Introduction to Computer Science Using Python 3>的更多相关文章

  1. Note 2 for <Pratical Programming : An Introduction to Computer Science Using Python 3>

    Book Imformation : <Pratical Programming : An Introduction to Computer Science Using Python 3> ...

  2. MIT Introduction to Computer Science and Programming (Lesson one )

    MIT Introduction to Computer Science and Programming (Lesson one ) 这篇文是记载 MIT 计算机科学及编程导论 第一集 的笔记 Les ...

  3. Introduction to Computer Science and Programming in Python--MIT

    学习总结--(Introduction to Computer Science and Programming in Python--MIT) 导论 主题 重新利用数据结构来表达知识 理解算法的复杂性 ...

  4. MITx: 6.00.1x Introduction to Computer Science and Programming Using Python Week 2: Simple Programs 4. Functions

    ESTIMATED TIME TO COMPLETE: 18 minutes We can use the idea of bisection search to determine if a cha ...

  5. edX MITx: 6.00.1x Introduction to Computer Science and Programming Using Python 课程 Week 1: Python Basics Problem Set 1 Problem 3

    Assume s is a string of lower case characters. Write a program that prints the longest substring of  ...

  6. 学习笔记之Introduction to Data Visualization with Python | DataCamp

    Introduction to Data Visualization with Python | DataCamp https://www.datacamp.com/courses/introduct ...

  7. Introduction to Computer Networks(网络架构与七层参考模式)

    Network Connectivity 1. Important terminologies 1) Link 设备连接的连线.Link本身既可以是有线的,也可以是无线的. 2) Node 设备.电脑 ...

  8. An Introduction to Computer Thinking

    1.Die Grundlage des Computers 1.1 Binärzahl in die Dezimalzahl umsetzen Bereiten nach Gewicht,dann b ...

  9. 书籍推荐-An introduction to Data Science

    为什么要读这本书? 该书是由我们老师推荐的,通过学习此数,可以了解R语言的使用,也可以知道基本的数据分析方法. 看到Creating a Data Set in R -- 24页面

随机推荐

  1. java-接口—策略模式

    策略模式,就是不同类继承相同的接口,实现不同的策略.

  2. BPTT

    RNN 的 BP —— Back Propagation Through Time. 参考:零基础入门深度学习(5) - 循环神经网络.知乎. 1 def backward(self, sensiti ...

  3. 使用dsoframer演示ppt

    优点: (1)不用直接打开PowerPoint (2)可以嵌入到Form中,那种先打开ppt然后将ppt嵌入到Form中的方式,会先打开PowerPoint 缺点: 很早就停止更新了....  但是没 ...

  4. CeSharp支持MP4

    因为CefSharp不支持MP4格式(因为版权问题,MP3因为版权过期新版本已经支持了),需要自己下载源码重新编译以支持MP4,或者下载被人编译好的库.因时间问题,我直接在csdn上下载了一个(1c币 ...

  5. error LNK2019 : unresolved external symbol Zbar配置问题

    原文链接:https://blog.csdn.net/MengchiCMC/article/details/77871714 出现error LNK2019 : unresolved external ...

  6. kubernetes(K8S)快速安装与配置集群搭建图文教程

    kubernetes(K8S)快速安装与配置集群搭建图文教程 作者: admin 分类: K8S 发布时间: 2018-09-16 12:20 Kubernetes是什么? 首先,它是一个全新的基于容 ...

  7. Navicat for Mysql查询结果导出无表名

    在查询窗口用select语句按条件查出所需结果,然后用“导出向导”把查询结果导成sql文件,但是导出来的sql语句没有表名了. 导成的sql文件大致是这样的, INSERT INTO `` (`id` ...

  8. Java-DateUtils工具类

    import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; impor ...

  9. springboot整合mongodb问题1-Decimal128和BigDecimal的转换之mongodb转换器使用(转)

    转自:https://blog.csdn.net/weixin_41792559/article/details/79575524 1.Decimal128的了解由于mongodb4.3以上新加了De ...

  10. vue中axios的二次封装

    我们做项目时,虽然axios也可以直接拿来用,但是对接口比较零散,不太好进行维护,也会产生大量的重复代码,所以我在这对axios进行了统一接口处理 第一步,先在src中的公共文件夹中如utils里新建 ...