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 web 项目 web.xml 配置文件加载过程

    转载自:http://blog.csdn.net/luoliehe/article/details/46884757#comments WEB加载web.xml初始化过程: 在启动Web项目时,容器( ...

  2. Centos7搭建solr集群

    1.复制4个Tomcat到solr-cloud目录下 [root@localhost software]# cp -r apache-tomcat-9.0.24 /usr/local/solr-clo ...

  3. 分享一个百万数量级的测试学习用的mysql数据集

    TEST_DB 带有集成测试套件的示例数据库,用于测试应用程序和数据库服务器 此存储库已从Launchpad迁移. 请参阅MySQL文档中的用法 它来自哪里 原始数据由西门子企业研究中心的Fushen ...

  4. 根文件系统ramdisk.image.gz && uramdisk.image.gz

    1. 根文件系统镜像ramdisk.image.gz和uramdisk.image.gz 通常需要将文件系统输入到Nand Flash当中时,一般可以将根文件系统打包成uramdisk.image.g ...

  5. Hadoop_04_Hadoop 的HDFS客户端shell命令

    1.Hdfs shell客户端命令操作: 1.1.查看命令列表:hadoop fs 帮助如下: Usage: hadoop fs [generic options] [-appendToFile &l ...

  6. springboot中解决servlet乱码问题,使用配置类注册过滤器解决

    8.1 使用传统的Spring提供的字符编码过滤器 在03-springboot-web中的ServletConfig中配置文件类,注册字符编码过滤器 @Bean public FilterRegis ...

  7. Beta冲刺——星期三

    这个作业属于哪个课程 <课程的链接> 这个作业要求在哪里 <作业要求的链接> 团队名称 飞猪们 这个作业的目标 剩余任务预估,分配任务(开发,测试等).按要求提交当天冲刺报告. ...

  8. ACwing 196. 质数距离

    #include <bits/stdc++.h> using namespace std; , M = ; int v[M]; long long prime[N],prim[N]; ; ...

  9. QTP(12)

    练习:录制两位数加法器加法计算后退出的步骤,对两个加数做随机数参数化,随机数范围是0-50,在计算后获得被测系统计算的结果,判断如果结果等于100,msgbox提示“满分”,如果结果在80和99之间, ...

  10. 神奇的系统bug

    这是报错的日志 Status bar could not find cached time string image. Rendering in-process