Note 1 for <Pratical Programming : An Introduction to Computer Science Using Python 3>
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>的更多相关文章
- 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> ...
- MIT Introduction to Computer Science and Programming (Lesson one )
MIT Introduction to Computer Science and Programming (Lesson one ) 这篇文是记载 MIT 计算机科学及编程导论 第一集 的笔记 Les ...
- Introduction to Computer Science and Programming in Python--MIT
学习总结--(Introduction to Computer Science and Programming in Python--MIT) 导论 主题 重新利用数据结构来表达知识 理解算法的复杂性 ...
- 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 ...
- 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 ...
- 学习笔记之Introduction to Data Visualization with Python | DataCamp
Introduction to Data Visualization with Python | DataCamp https://www.datacamp.com/courses/introduct ...
- Introduction to Computer Networks(网络架构与七层参考模式)
Network Connectivity 1. Important terminologies 1) Link 设备连接的连线.Link本身既可以是有线的,也可以是无线的. 2) Node 设备.电脑 ...
- An Introduction to Computer Thinking
1.Die Grundlage des Computers 1.1 Binärzahl in die Dezimalzahl umsetzen Bereiten nach Gewicht,dann b ...
- 书籍推荐-An introduction to Data Science
为什么要读这本书? 该书是由我们老师推荐的,通过学习此数,可以了解R语言的使用,也可以知道基本的数据分析方法. 看到Creating a Data Set in R -- 24页面
随机推荐
- 8.Hibernate性能优化
性能优化 1.注意session.clear() 的运用,尤其在不断分页的时候 a) 在一个大集合中进行遍历,遍历msg,取出其中额含有敏感字样的对象 b) 另外一种形式的内存泄漏( //面试题:Ja ...
- go语言入门(5)工程管理
在工程中不会简单到只有一个源代码文件,且源文件之间会有相互的依赖关系,早期Go语言使用makefile作为工程管理的临时方案,后来的Go命令行工具的革命性之处在于彻底消除了工程文件的概念,完全用目录结 ...
- Windows live Writer Tips
http://lehsys.blogspot.com/2013/03/windows-live-writer-how-to-change.html http://www.carlosag.net/to ...
- deep_learning_neural network梯度下降
神经网络优化算法:梯度下降法.Momentum.RMSprop和Adam 最近回顾神经网络的知识,简单做一些整理,归档一下神经网络优化算法的知识.关于神经网络的优化,吴恩达的深度学习课程讲解得非常通俗 ...
- mysql数据库:mysql初识
1.什么是数据库 ***** 存放数据的仓库 已学习的文件操作的缺陷 1.IO操作 效率问题 2.多用户竞争数据 3.网络访问 ...
- Ubuntu 18.04 启动太慢不能忍
检查谁在搞鬼 $ systemd-analyze blame 结果 39.828s plymouth-quit-wait.service 39.311s apt-daily.service 30.93 ...
- Mysql索引类型分析
一.简介 MySQL目前主要有以下几种索引类型: 1.普通索引 2.唯一索引 3.主键索引 4.组合索引 5.全文索引 二.语句 CREATE TABLE table_na ...
- POJ - 1185 炮兵阵地 (插头dp)
题目链接 明明是道状压dp的题我为啥非要用插头dp乱搞啊 逐行枚举,设dp[i][S]为枚举到第i个格子时,状态为S的情况.S为当前行上的“插头”状态,每两个二进制位表示一个格子,设当前格子为(x,y ...
- .Net界面开发控件DevExpress Winforms v19.2发布!增强图表功能
DevExpress Winforms Controls 内置140多个UI控件和库,完美构建流畅.美观且易于使用的应用程序.无论是Office风格的界面,还是分析处理大批量的业务数据,DevExpr ...
- MQTT 入门介绍——菜鸟教程
一.简述 MQTT(Message Queuing Telemetry Transport,消息队列遥测传输协议),是一种基于发布/订阅(publish/subscribe)模式的"轻量级& ...