learn python the hard way 习题1~5总结
习题1
print 语句
print('Yay! Printing.')
print('I "said" do not touch this')
习题2:注释和 # 号
#(octothorpe),用于注释一条语句,在 # 之后的内容全部被忽略。
习题3:数字和数字计算
当进行关系运算的时候,比如 3+2<5-7,那么返回的是一个 True 或者 False
习题4:变量和命名
设定变量之后,可以在以后的时候用到。
习题5:更多的变量和打印
print(f"{}")
f告诉python 后面的{}是一段格式化的输出,{}中可包含数字和字符串
learn python the hard way 习题1~5总结的更多相关文章
- learn python the hard way 习题6~10总结
习题6总结 定义字符串: 名字 = 值 其他 你也可以用 {types_of_people}的方式把它放在任何字符串中. 也就是说你可以在其他字符串中添加{},然后前面加一个 f,可用print()进 ...
- learn python the hard way习题31~40总结以及列表的扩展知识
Python 中的列表: 形式:[ 表示打开一个列表,中间的项目用 , 隔开,然后列表以 ] 结束. for循环 两种形式: for i in ArrayName: for i in range(0, ...
- learn python the hard way 习题18~25总结
定义函数和调用函数的语法 定义函数 形式: def functionName(p1,p2): statement other statement 需要注意: 紧跟者函数定义的代码是否使用了4个空格的缩 ...
- 笨办法学 Python (Learn Python The Hard Way)
最近在看:笨办法学 Python (Learn Python The Hard Way) Contents: 译者前言 前言:笨办法更简单 习题 0: 准备工作 习题 1: 第一个程序 习题 2: 注 ...
- 学 Python (Learn Python The Hard Way)
学 Python (Learn Python The Hard Way) Contents: 译者前言 前言:笨办法更简单 习题 0: 准备工作 习题 1: 第一个程序 习题 2: 注释和井号 习题 ...
- 《Learn python the hard way》Exercise 48: Advanced User Input
这几天有点时间,想学点Python基础,今天看到了<learn python the hard way>的 Ex48,这篇文章主要记录一些工具的安装,以及scan 函数的实现. 首先与Ex ...
- [IT学习]Learn Python the Hard Way (Using Python 3)笨办法学Python3版本
黑客余弦先生在知道创宇的知道创宇研发技能表v3.1中提到了入门Python的一本好书<Learn Python the Hard Way(英文版链接)>.其中的代码全部是2.7版本. 如果 ...
- learn the python the hard way习题26~30总结
考试试题26错误总结: 漏写字母,括号 写错字母 write(),read()的使用:只能打开使用了 open() 后返回的文件对象(file object),而不能直接使用文件名 if 语句中,条件 ...
- learn the python the hard way习题11~17总结
关于 input() 格式: input("prompt")功能:从 CLI 获取 User 的一个输入,显示 promt 的内容,并且返回一个 string 类型的数值其他:如果 ...
随机推荐
- javascript 点击按钮实现隐藏显示切换效果
原文链接:http://www.jb51.net/article/79083.htm <html> <head> <meta charset="gb2312&q ...
- Magnum Kubernetes源码分析(一)
Magnum版本说明 本文以magnum的mitaka版本代码为基础进行分析. Magnum Kubernetes Magnum主要支持的概念有bay,baymodel,node,pod,rc,ser ...
- repo回退当前分支下所有仓库到指定日期前的最新代码版本【转】
本文转载自:https://blog.csdn.net/u011006622/article/details/70272087 执行下面这样的repo命令就行了: repo forall -c 'c ...
- centos6.8下如何升级git版本?
1. 安装开发环境 yum install -y curl curl-devel zlib-devel openssl-devel perl cpio expat-devel gettext-deve ...
- npm的安装和使用?
参考: http://www.cnblogs.com/chyingp/p/npm.html 在css中使用变量, 采用less或sass来编译css 改变网页网站开发和构建的方式, 除了用emmet( ...
- (转)Spring Cloud(一)
(二期)22.微服务框架spring cloud(一) [课程22]spirng c...简介.xmind54KB [课程22]spirng cl...架构.xmind0.5MB [课程22]负载均. ...
- Restructure output of R summary function
Treat it as a data.frame: set.seed(1)x <- sample(30, 100, TRUE) summary(x)# Min. 1st Qu. Medi ...
- ocacle sql: 两张表左连接 ,1对多,取一条数据,取按时间最新的
说明: MBGL_GZJH jh_id 对应 mbgl_gzjh_fkmx jh_id mbgl_gzjh_fkmx jh_id 有重复多条,但是 FKRQ 不一样,我们去 FKRQ 最新的一条. s ...
- Visual Question Answering with Memory-Augmented Networks
Visual Question Answering with Memory-Augmented Networks 2018-05-15 20:15:03 Motivation: 虽然 VQA 已经取得 ...
- (zhuan) awesome-object-proposals
awesome-object-proposals A curated list of object proposals resources for object detection. This ...