习题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总结的更多相关文章

  1. learn python the hard way 习题6~10总结

    习题6总结 定义字符串: 名字 = 值 其他 你也可以用 {types_of_people}的方式把它放在任何字符串中. 也就是说你可以在其他字符串中添加{},然后前面加一个 f,可用print()进 ...

  2. learn python the hard way习题31~40总结以及列表的扩展知识

    Python 中的列表: 形式:[ 表示打开一个列表,中间的项目用 , 隔开,然后列表以 ] 结束. for循环 两种形式: for i in ArrayName: for i in range(0, ...

  3. learn python the hard way 习题18~25总结

    定义函数和调用函数的语法 定义函数 形式: def functionName(p1,p2): statement other statement 需要注意: 紧跟者函数定义的代码是否使用了4个空格的缩 ...

  4. 笨办法学 Python (Learn Python The Hard Way)

    最近在看:笨办法学 Python (Learn Python The Hard Way) Contents: 译者前言 前言:笨办法更简单 习题 0: 准备工作 习题 1: 第一个程序 习题 2: 注 ...

  5. 学 Python (Learn Python The Hard Way)

    学 Python (Learn Python The Hard Way) Contents: 译者前言 前言:笨办法更简单 习题 0: 准备工作 习题 1: 第一个程序 习题 2: 注释和井号 习题 ...

  6. 《Learn python the hard way》Exercise 48: Advanced User Input

    这几天有点时间,想学点Python基础,今天看到了<learn python the hard way>的 Ex48,这篇文章主要记录一些工具的安装,以及scan 函数的实现. 首先与Ex ...

  7. [IT学习]Learn Python the Hard Way (Using Python 3)笨办法学Python3版本

    黑客余弦先生在知道创宇的知道创宇研发技能表v3.1中提到了入门Python的一本好书<Learn Python the Hard Way(英文版链接)>.其中的代码全部是2.7版本. 如果 ...

  8. learn the python the hard way习题26~30总结

    考试试题26错误总结: 漏写字母,括号 写错字母 write(),read()的使用:只能打开使用了 open() 后返回的文件对象(file object),而不能直接使用文件名 if 语句中,条件 ...

  9. learn the python the hard way习题11~17总结

    关于 input() 格式: input("prompt")功能:从 CLI 获取 User 的一个输入,显示 promt 的内容,并且返回一个 string 类型的数值其他:如果 ...

随机推荐

  1. android拨号

    android:textColor="#A0ff1400" A0表示透明度00完全透明FF完全不透明,后面6位是RGB问题:类中类的findViewById方法为何用不了?解:类中 ...

  2. forever 用法

    安装过Node.js后再安装forever,需要加-g参数,因为forever要求安装到全局环境下: npm install forever -g 常用指令: npm install forever ...

  3. 20145326蔡馨熤《网络对抗》—— Web基础

    20145326蔡馨熤<网络对抗>—— Web基础 1.实验后回答问题 (1)什么是表单. 表单是一个包含表单元素的区域,表单元素是允许用户在表单中输入信息的元素,表单在网页中主要负责数据 ...

  4. Codeforces Round #423 (Div. 2, rated, based on VK Cup Finals) Problem E (Codeforces 828E) - 分块

    Everyone knows that DNA strands consist of nucleotides. There are four types of nucleotides: "A ...

  5. 网络 --- 4 socketserver模块并发 连接合法性

    一.socketserver模块 ②服务端 ③客户端 二.连接合法性       ①os.urandom(n) 一种bytes类型的随机生成n个字节字符串的方法 而且每次生成的值都不相同.再加上md5 ...

  6. 网络 --- 1 c/s (b/s)架构 ip 初始socket

    一.c/s   b/s c/s架构:客户端(client)/服务器(server) 软件cs架构:微信,陌陌,qq等 硬件cs架构:打印机 b/s架构:浏览器(browser)/服务器(server) ...

  7. Windows Installation

    If you're running on Windows it is good to run Jenkins as a service so it starts up automatically wi ...

  8. ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined) A

    2018-02-19 A. Palindromic Supersequence time limit per test 2 seconds memory limit per test 256 mega ...

  9. 【论文笔记】Learning Convolutional Neural Networks for Graphs

    Learning Convolutional Neural Networks for Graphs 2018-01-17  21:41:57 [Introduction] 这篇 paper 是发表在 ...

  10. (zhuan) 自然语言处理中的Attention Model:是什么及为什么

    自然语言处理中的Attention Model:是什么及为什么 2017-07-13 张俊林 待字闺中 要是关注深度学习在自然语言处理方面的研究进展,我相信你一定听说过Attention Model( ...