![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python学习记录
丰了个丰
这个作者很懒,什么都没留下…
展开
-
python之函数入门
整个专栏皆为《笨办法学python3》的学习内容,只是在书本的内容上根据本人的学习进行的记录,方便之后的回顾。1、函数的基本结构def function_name(in_put): content return output这里的input和output可以是打包后的东西,打包解包让函数看起来更加简洁。比如:def function_name(*in_put): input1,input2=in_put content return outputpyth原创 2021-02-02 17:50:16 · 113 阅读 · 0 评论 -
python读写文件
open函数open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None) Open file and return a stream. Raise OSError upon failure. file is either a text or byte string giving the name (and the path if th原创 2021-01-28 22:33:09 · 139 阅读 · 0 评论 -
python参数输入(input&argv)
input函数input(prompt=None, /)Read a string from standard input. The trailing newline is stripped.The prompt string, if given, is printed to standard output without atrailing newline before reading input.If the user hits EOF (*nix: Ctrl-D, Windows: Ct原创 2021-01-28 13:05:22 · 1600 阅读 · 1 评论 -
python之print
print(a+b)&print(a*5)案例1a = 1b = 2print(a+b)print(a,b)c = "one"d = "two"print(c+d)print(c,d)e = "haha"print(e*5)输出31 2onetwoone twohahahahahahahahahaha案例2f = "alpha!"g = " alpha!"h = "\talpha!"i = "\nalpha!"print(f)print(g)原创 2021-01-27 22:46:37 · 775 阅读 · 1 评论 -
python格式化字符记录
案例1topic = 'monkey'print(f"let's talk about {topic}.") 输出let’s talk about monkey.案例2A = "apple"B = "banana"y = f"{A} and {B}"print(y)输出apple and banana案例3hilarious=Falsejoke_evaluation = "Isn't that joke so funny?! {}"print(joke_evaluation原创 2021-01-27 22:24:42 · 98 阅读 · 0 评论