- 博客(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 477 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 159
原创 文件读写总遇到的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 896
原创 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 173
原创 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 123
原创 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 258
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人