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页面
随机推荐
- (十)全志R18 Tina平台关闭所有串口打印的方法
全志R18 Tina平台关闭所有打印输出方法: 有些国外的产品安全认证,如亚马逊Alexa认证,认证机构会不停地点pcb上的点,看有没有东西输出,有的话就通过这些口想办法破解设备,所以安全认证会要求设 ...
- Hadoop_08_客户端向HDFS读写(上传)数据流程
1.HDFS的工作机制: HDFS集群分为两大角色:NameNode.DataNode (Secondary Namenode) NameNode负责管理整个文件系统的元数据 DataNode 负责管 ...
- 11.tensorboard网络结构
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # 载入数据集 mnist = i ...
- facenet中pairs文件制作
1.对图片进行重命名 """Rename the image based on the folder name""" import os i ...
- 配置LANMP环境(7)-- 配置nginx反向代理,与配置apache虚拟主机
一.配置nginx反向代理 1.修改配置文件 vim /etc/nginx/nginx.conf 在35行http下添加一下内容: include /data/nginx/vhosts/*.conf; ...
- CSS基础学习-4.CSS属性_背景、颜色、边框
- kubernetes 创建超级管理员和密匙
# 创建一个超级管理员adm_account="k8s-dash-admin"kubectl create serviceaccount ${adm_account} -n kub ...
- 对bloom的理解 及优化
varying uv放到vs 讲下bloom的细节 上图这种做法 temporally stable box filtering up 的时候 需要filter 上述upscale有两张srv dow ...
- js 原生ajax请求
什么是ajax 所有现代浏览器均支持 XMLHttpRequest 对象(IE5 和 IE6 使用 ActiveXObject). XMLHttpRequest 用于在后台与服务器交换数据.这意味着可 ...
- 【Andriod-AlertDialog控件】 弹出对话框AlertDialog用法
Result: Code: import android.app.Activity; import android.app.AlertDialog; import android.content.Di ...