自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

learn python 3 the hard way

笨方法学 python3

  • 博客(7)
  • 收藏
  • 关注

转载 ex35 代码流程图

from sys import exitdef gold_room(): print("This room is full of gold. How much do you take?") choice = input(">") if "0" in choice or "1" in choice: how_much = int(choice)...

2019-02-12 13:50:56 475 2

原创 ex25 新增函数说明

1.python sorted:sorted() 函数对所有可迭代的对象进行排序操作sort 与 sorted 区别:sort 是应用在 list 上的方法,sorted 可以对所有可迭代的对象进行排序操作。list 的 sort 方法返回的是对已经存在的列表进行操作,无返回值,而内建函数 sorted 方法返回的是一个新的 list,而不是在原来的基础上进行的操作。#!/u...

2019-02-05 04:02:06 177

原创 ex19 函数和变量 习题三 自编函数

一、ex19_1.py# this is ex19's excristdef Burst_price(user_name, basic_pay, performance_pay, performance_score): print(f"Hi,{user_name}") print(f"Your basic pay is {basic_pay} $.") prin...

2019-01-31 14:14:10 157

原创 文件读写总遇到的python .read()问题

from sys import argvfrom os.path import existsscript, to_file, in_file = argvprint(f"copying {to_file} to {in_file}")x_file = open(to_file)indata = x_file.read()print(x_file.read())print(f...

2019-01-30 16:09:33 894

原创 ex12 input的格式化输入,pydoc的引用规则

input 的两种格式1.print("How old are you?" end = '')age = input()2.age = input("How old are you?") pydoc的语法规则python -m pydoc input # input可谓任意函数或者字段 ...

2019-01-28 13:43:10 172

原创 ex5 More Variables and Printing

 用下面的格式print(f"Let's talk about {name}.")替代 print("Let's talk about %s.",% name)更直观和方便  

2019-01-24 19:06:25 122

原创 ex3 Rewrite ex3.py to use floating point numbers so it's more accurate. 20.0 is floating point.

输出浮点型数据格式print("%.2f" % a) 

2019-01-24 15:58:11 255

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除