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. Redis-Hash常用命令

    Redis-Hash常用命令 hset key field value 设置一个散列,但是在散列中一次只能设置一个属性,如果要批量设置多个属性,则需要使用 hmset命令 hget key field ...

  2. 入坑django2

    数据模型 关于时间的字段设置 add_date = models.DateTimeField('保存日期',default = timezone.now) mod_date = models.Date ...

  3. centos 7 源代码搭建部署 zabbix-4.0.13 LTS

    Zabbix 官网 >:https://www.zabbix.com/download 源代码地址>:https://www.zabbix.com/cn/download_sources# ...

  4. C语言特殊函数的应用

    1. va_list相关函数的学习: va_list是一种变参量的指针类型定义. va_list使用方法如下: 1)首先在函数中定义一个具有va_list型的变量,这个变量是指向参数的指针. 2)首先 ...

  5. 6.Nginx的session一致性(共享)问题配置方案2

    1.利用memcached配置session一致性的另外一种方案tengine的会话保持功能 1.1:Tengine会话保持:通过cookie来实现的 该模块是一个负载均衡模块,通过cookie实现客 ...

  6. POJ1722 算法竞赛进阶指南 SUBSTRACT减操作

    原题连接 题目描述 给定一个整数数组\(a_1,a_2,-,a_n\). 定义数组第 i 位上的减操作:把\(a_i\)和\(a_{i+1}\)换成\(a_i - a_{i+1}\). 用con(a, ...

  7. Linux之vi文本编辑器

    vi的基本概念 基本上vi可以分为三种状态,分别是命令模式(command mode).输入模式(Insert mode)和末行模式(last line mode),各模式的功能区分如下: 1) 命令 ...

  8. 微服务框架SpringCloud与Dubbo

    #v1.0.0# 1.背景 Dubbo,是阿里巴巴服务化治理的核心框架,并被广泛应用于阿里巴巴集团的各成员站点.阿里巴巴近几年对开源社区的贡献不论在国内还是国外都是引人注目的,比如:JStorm捐赠给 ...

  9. [易学易懂系列|rustlang语言|零基础|快速入门|(5)|生命周期Lifetime]

    [易学易懂系列|rustlang语言|零基础|快速入门|(5)] Lifetimes 我们继续谈谈生命周期(lifttime),我们还是拿代码来说话: fn main() { let mut a = ...

  10. +new Date是什么意思?

    转载自:http://blog.csdn.net/abxn2002/article/details/53420816 JavaScript中可以在某个元素前使用 ‘+’ 号,这个操作是将该元素转换成N ...