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页面
随机推荐
- Spring讲解-----------表达式语言
转自:https://blog.csdn.net/u011225629/article/details/47143083 5.1 概述5.1.1 概述 Spring表达式语言全称为“S ...
- python3中OS模块
os模块 OS模块简单的来说它是一个Python的系统编程的操作模块,可以处理文件和目录这些我们日常手动需要做的操作. 可以查看OS模块的帮助文档: import os:#导入os模块 help(os ...
- delphi FMX APP程序图标,闪屏,程序名
- NORDIC 修改MTU
https://www.cnblogs.com/jiangjiu/p/10063556.html 注意要修改RAM起始地址,因为MTU增大了
- 自然语言处理(三) 预训练模型:XLNet 和他的先辈们
预训练模型 在CV中,预训练模型如ImagNet取得很大的成功,而在NLP中之前一直没有一个可以承担此角色的模型,目前,预训练模型如雨后春笋,是当今NLP领域最热的研究领域之一. 预训练模型属于迁移学 ...
- JVM锁说明
以前Synchronised关键字加锁效率问题,经常受到吐槽.后来java的开发团队进行了优化,引入了偏向锁.自旋锁.轻量锁,性能有了很大的提升.下面我们来分析下这里面的过程和原理. ...
- loj2613 「NOIP2013」华容道[最短路]
感觉和以前做过的一个推箱子很像,都是可以用bfs解决的,而且都是手玩出结论. 因为起始棋子肯定是要和空格交换的,所以第一件事是先把空格移到棋子旁边.然后讨论怎么设计搜索状态.由于和推箱子实在太像了,所 ...
- mac 环境下Android 反编译源码
mac环境下Android 反编译 一.需要的工具 apktool:反编译APK文件,得到classes.dex文件,同时也能获取到资源文件以及布局文件. dex2jar:将反编译后的classes. ...
- 闭包-IIFE
1)嵌套函数,内部函数访问了外部函数的局部变量,通过返回内部函数,在函数外部调用内部函数,从而更新外部函数的局部变量的过程: 2)代码执行完成之后离开作用域依旧存在 3)有可能发生内存泄露,若对象的引 ...
- 【JZOJ5603】【NOI2018模拟3.27】Xjz
题目描述 给定字符串 S 和 T. 串A和串B匹配的定义改为:存在一个字符的映射,使得A应用这个映射之后等于B,且这个映射必须为一个排列. A=121, B=313,当映射为{1->3, 2-& ...