广告
返回顶部
首页 > 资讯 > 后端开发 > Python >python学习笔记11-python内
  • 149
分享到

python学习笔记11-python内

学习笔记python 2023-01-31 06:01:55 149人浏览 八月长安

Python 官方文档:入门教程 => 点击学习

摘要

python学习笔记11-python内置函数一、查看python的函数介绍:https://docs.python.org/2/library/ 二、python内置函数1、abs获取绝对值:通过Python官网查看absabs(x)Re

python学习笔记11-python内置函数


一、查看python的函数介绍:

https://docs.python.org/2/library/


二、python内置函数

1、abs获取绝对值:

通过Python官网查看abs

  • abs(x)

  • Return the absolute value of a number. The argument may be a plain or long integer or a floating point number. If the argument is a complex number, its magnitude is returned.


通过help查看abs

In [20]: help(abs)

Help on built-in function abs in module __builtin__:

abs(...)

    abs(number) -> number    #返回一个number

    Return the absolute value ofthe argument. #返回绝对值

(END) 

abs实例:

In [14]: def fun(x):
    ...:     if x < 0:
    ...:         return -x
    ...:     return x
    ...: 
In [15]: fun(10)
Out[15]: 10
In [16]: fun(-10)
Out[16]: 10
In [17]: abs(-10)
Out[17]: 10
In [18]: abs(10)
Out[18]: 10
In [19]: abs(-100)
Out[19]: 100


2、max()min()列表的最大值和最小值

In [22]: max([1,2,3,4,5])
Out[22]: 5
In [23]: min([1,2,3,4,5])
Out[23]: 1
Help on built-in function max in module __builtin__:
max(...)
    max(iterable[, key=func]) -> value  #可迭代的对象
    max(a, b, c, ...[, key=func]) -> value    
    With a single iterable argument, return its largest item.#返回最大的参数
    With two or more arguments, return the largest argument.
In [26]: max('hsdhsjd','5687','12') #最长的一个
Out[26]: 'hsdhsjd'


3、获取长度len()

In [27]: s='1234'
In [28]: len(s)  #取字符创的长度
Out[28]: 4
help(len)
Help on built-in function len in module __builtin__:
len(...)
    len(object) -> integer    #处理对象,返回整数 
    Return the number of items of a sequence or collection.
In [31]: len([1,2])#取列表的元素个数,2个
Out[31]: 2   
In [30]: len(('a',)) #取元祖的元素个数,1个
Out[30]: 1
In [32]: len({'a':3,'d':4})  #len()统计字典有几对key,value
Out[32]: 2


4、商和余数divmod() 

In [35]: help(divmod)
divmod(...)
    divmod(x, y) -> (quotient, remainder)    
    Return the tuple ((x-x%y)/y, x%y).  Invariant: div*y + mod == x.
(END) 
In [36]: divmod(5,2)  
Out[36]: (2, 1)    #商和余数


5、pow()次方&取余

In [37]: help(pow)
Help on built-in function pow in module __builtin__:
pow(...)
    pow(x, y[, z]) -> number    
    With two arguments, equivalent to x**y.  With three arguments,
    equivalent to (x**y) % z, but may be more efficient (e.g. for longs).
(END) 
In [38]: pow(2,3)   #两个参数,结果是x的y次方
Out[38]: 8

In [40]: pow(2,3,3) #三个参数,结果是x的y次方之后,2^3=8,8%3=2,再取个余结果是2,也就是取模
Out[40]: 2
In [39]: pow(2,3,4)
Out[39]: 0


6、round()

第一步把数字变为浮点数,

第二步,没有第二参数,把一个数字四舍五入,默认保留一位小数点.0 ,有第二个参数,第二个参数是保留几位小数

In [41]: help(round)
Help on built-in function round in module __builtin__:
round(...)
    round(number[, ndigits]) -> floating point number    
    Round a number to a given precision in decimal digits (default 0 digits).
    This always returns a floating point number.  Precision may be negative.
(END) 
In [53]: print round(12.145) #默认是
12.0
In [15]: round(12.145,1)
Out[15]: 12.1
In [14]: round(12.145,2)
Out[14]: 12.14
In [54]: print round(12.145,3) 
12.145
In [55]: print round(12.145,4) 
12.145


7、callable()对象是否可调用的?

In [63]: help(callable)  
Help on built-in function callable in module __builtin__:
callable(...)
    callable(object) -> bool #返回一个bool值   
    Return whether the object is callable (i.e., some kind of function).
    Note that classes are callable, as are instances with a __call__() method.

In [64]: a = 123
In [65]: callable(a)  #字符a不可调用
Out[65]: False

In [66]: def b():
    ...:     pass
    ...: 
In [67]: callable(b)#函数b可调用
Out[67]: True
    
In [69]: class A(object):  #定义了一个对象也是可调用的,返回true
    ...:     pass
    ...: 
In [70]: callable(A)
Out[70]: True


8、type()确定类型

In [66]: def b():
    ...:     pass
In [73]: print type(b)  #b为function函数类型
<type 'function'>

In [64]: a = 123
In [74]: print type(a) #a是int×××
<type 'int'>
In [75]: print type([])
<type 'list'>


9、isinstance(a,int)判断是不是指定类型,是的话返回True,不是的话,返回False

In [19]: isinstance(a,int)
Out[19]: True
In [25]: l = [1,32]
In [28]: if type(l) == type([]):
    ...:     print 'ok'
    ...:     
ok
In [29]: isinstance(l,list)
Out[29]: True

In [30]: isinstance(l,tuple)
Out[30]: False

In [36]: isinstance(l,(list,tuple,str)) #l是list或者tuple或者str吗?是的,就返回True
Out[36]: True

10、cmp()比较数字或者字符串的大小

In [55]: cmp(2,5)
Out[55]: -1

In [56]: cmp(2,2)
Out[56]: 0

In [57]: cmp(2,1)
Out[57]: 1

In [61]: cmp('hello','hello') #字符串相同,返回0
Out[61]: 0
In [63]: cmp('zello','hello')#首字母,z>h的ASCII值,所以,返回1
Out[63]: 1
In [62]: cmp('hello,world','hello')#逗号,的ASCII值大于null=0,返回1,
Out[62]: 1
In [65]: cmp('aellohello','hello')#ASCII值a<h,返回-1
Out[65]: -1


11、range和xrange()

In [75]: a=range(10) #直接分配内存,消耗资源

In [76]: a
Out[76]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

In [77]: b=xrange(10)

In [78]: b
Out[78]: xrange(10)  #在循环遍历的时候再分配资源,节约资源

In [79]: for i in b:print i
0
1
2
3
4
5
6
7
8
9


二、python类型转换


1、int()转换为×××,如果转换字符串,必须全是数字,不能包括其他非数字字符

In [123]: int(0x12)
Out[123]: 18
In [1]: int('54')
Out[1]: 54


In [124]: int('0x12') #错,字符串包含了非数字x,只能是‘12’才能转为int  12
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-124-d8b06269903D> in <module>()
----> 1 int('0x12')

ValueError: invalid literal for int() with base 10: '0x12'

In [85]: int('12.479')#错,字符串包含了非数字 '.',只能是‘12479’才能转为int 12479,
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-85-4191248f183f> in <module>()
----> 1 int('12.479')

ValueError: invalid literal for int() with base 10: '12.479'


2、long()转换为长×××,与int类似用法,转换字符串不能包括非数字的字符

In [87]: long(12.4)
Out[87]: 12L

In [88]: long(12.5678)
Out[88]: 12L

In [89]: long('12')
Out[89]: 12L

In [90]: long('12.4')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-90-5122883443e4> in <module>()
----> 1 long('12.4')

ValueError: invalid literal for long() with base 10: '12.4'


3、hex()转换为16进制

hex(...)
    hex(number) -> string  #返回16进制的字符串,参数是int或者长×××Long int
    Return the hexadecimal representation of an integer or long integer.
In [117]: hex(12)
Out[117]: '0xc'


4、float()转换为float类型

In [98]: float('123')
Out[98]: 123.0

In [99]: float(123)
Out[99]: 123.0


5、转换为复数类型

In [100]: complex(123)
Out[100]: (123+0j)


6、str(),转换为string字符串类型

In [104]: str(123)
Out[104]: '123'

In [105]: str('123')
Out[105]: '123'

In [106]: str([1,2])
Out[106]: '[1, 2]'

In [107]: str({'1':1})
Out[107]: "{'1': 1}"

In [108]: str((1,[2,3]))
Out[108]: '(1, [2, 3])'


7、list()转换为列表

class list(object)
 |  list() -> new empty list #参数为空,返回空列表
 |  list(iterable) -> new list initialized from iterable's items#参数是可迭代对象,返回迭代元素的新列表
In [110]: list('123')  参数是可迭代对象,返回迭代元素的新列表
Out[110]: ['1', '2', '3']

In [111]: list()#参数为空,返回空列表
Out[111]: []

In [112]: list((3,4,[56]))
Out[112]: [3, 4, [56]]

In [113]: list((3,4,[5,6]))#把元祖变为列表
Out[113]: [3, 4, [5, 6]]



8、tuple()转换为元祖

In [114]: tuple([3, 4, [5, 6]])#把列表变为元祖
Out[114]: (3, 4, [5, 6])


9、eval()就是字符串去字符化,删除引号,把字符串当成有效的表达式求值

In [127]: eval('0xa')
Out[127]: 10
In [2]: type(eval('0xa'))#注意转换后类型是int
Out[2]: int
In [129]: eval("['a','b',1]")
Out[129]: ['a', 'b', 1]


10、oct()转换为8进制

In [131]: oct(10)
Out[131]: '012'

11、chr()返回ASCII值0-255对应的字符

In [148]: chr(65)
Out[148]: 'A'


12、ord()返回字符的ASCII值

In [143]: ord('a')
Out[143]: 97

In [144]: ord('A')
Out[144]: 65


三、字符串处理函数

1、str.capitalizw()

In [159]: s='hello,world'
In [160]: help(s.capitalize)
capitalize(...)
    S.capitalize() -> string #返回字符串,首字母大写
    Return a copy of the string S with only its first character
    capitalized.
In [161]: s.capitalize()
Out[161]: 'Hello,world'    #H已经变为大写


2、str.replace()

replace(...)
    S.replace(old, new[, count]) -> string #用新字符串替换旧字符串,count定义替换几次
    
    Return a copy of string S with all occurrences of substring
    old replaced by new.  If the optional argument count is
    given, only the first count occurrences are replaced.
    
In [172]: s.replace('h','H')  #用H替换所有h
Out[172]: 'Hello,world,H'  
In [169]: s.replace('h','H',1)#用H替换所有h,如果为1,只替换第一次出现的h
Out[169]: 'Hello,world,h'

In [170]: s.replace('h','H',2)#用H替换所有h,如果为2,只替换前2次出现的h
Out[170]: 'Hello,world,H'

3、str.split()

split(...)
    S.split([sep [,maxsplit]]) -> list of strings
    
    Return a list of the Words in the string S, using sep as the
    delimiter string.  If maxsplit is given, at most maxsplit
    splits are done. If sep is not specified or is None, any
    whitespace string is a separator and empty strings are removed
    from the result.

In [176]: s1='abc'
In [177]: s1.split()
Out[177]: ['abc']

In [174]: s = 'hello  a\tb\nc'
In [175]: s.split()  #默认空格、tab、enter换行都会作为分隔符切分字符串
Out[175]: ['hello', 'a', 'b', 'c']    

#分别以换行\n,空格' ',tab为分割符切换字符串
In [180]: s.split('\n')
Out[180]: ['hello  a\tb', 'c']

In [181]: s.split(' ')
Out[181]: ['hello', '', 'a\tb\nc']

In [182]: s.split('\t')
Out[182]: ['hello  a', 'b\nc']
In [183]: ip = '192.168.1.1'
In [185]: ip.split('.')
Out[185]: ['192', '168', '1', '1']
In [186]: ip.split('.',2)
Out[186]: ['192', '168', '1.1']

In [187]: ip.split('.',1)
Out[187]: ['192', '168.1.1']

4、str.join()

In [188]: help(str.join)
join(...)
    S.join(iterable) -> string#参数是可迭代的对象,返回的是字符串
    
    Return a string which is the concatenation of the strings in the
    iterable.  The separator between elements is S.
In [189]: s1='abc'

In [190]: s1.join('12') #在1,2之间使用abc去连接
Out[190]: '1abc2'

In [191]: s1.join('123')#在1,2,3之间用abc去连接
Out[191]: '1abc2abc3'

In [194]: ''.join(str(i) for i in range(10))#把列表的每个元素通过列表重写变为字符串
Out[194]: '0123456789'

In [195]: ' '.join(str(i) for i in range(10))
Out[195]: '0 1 2 3 4 5 6 7 8 9'
In [197]: int(''.join(str(i) for i in range(10)))
Out[197]: 123456789

5、string模块

In [198]: import string

In [199]: string.upper('abc')
Out[199]: 'ABC'

In [200]: string.lowercase
Out[200]: 'abcdefghijklmnopqrstuvwxyz'

In [201]: string.uppercase
Out[201]: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

In [202]: help(string.capitalize)


In [203]: string.capitalize('hello')
Out[203]: 'Hello'

In [204]: help(string.replace)


In [205]: string.replace('hello','o','O')
Out[205]: 'hellO'

In [206]: s
Out[206]: 'hello  a\tb\nc'

In [207]: s.replace('h','H')
Out[207]: 'Hello  a\tb\nc'


三、序列处理函数

1、filter()数据过滤处理函数,例子:把range(10)通过函数f处理,偶数显示在列表中,function = None,不处理直接返回原来的列表

filter(...)
    filter(function or None, sequence(序列)) -> list, tuple, or string#序列的元素都会被函数处理
    
    Return those items of sequence for which function(item) is true.  If
    function is None, return the items that are true.  If sequence is a tuple
    or string, return the same type, else return a list
In [275]: filter(None,range(10))  #function是None,不处理直接返回range(10)
Out[275]: [1, 2, 3, 4, 5, 6, 7, 8, 9]
In [271]: def f(x):
     ...:     if x %2 == 0:
     ...:         return True
     ...:     
In [273]: filter(f,range(10)) #把range(10)通过函数f处理,偶数显示在列表中
Out[273]: [0, 2, 4, 6, 8]

#filter使用匿名函数lambda
In [303]: filter(lambda x: x%2==0,range(10))#表示,lambda x成立的条件是:x%2==0并且x属于range(10)
Out[303]: [0, 2, 4, 6, 8]


2、zip()对多个序列处理,合并成一个大的序列

zip(...)
    zip(seq1 [, seq2 [...]]) -> [(seq1[0], seq2[0] ...), (...)]
    
    Return a list of tuples, where each tuple contains the i-th element
    from each of the argument sequences.  The returned list is truncated
    in length to the length of the shortest argument sequence.#最小的参数
In [277]: l1 = [1,2,3]
In [278]: l2 = ['a','b','c']
In [279]: zip(l1,l2)
Out[279]: [(1, 'a'), (2, 'b'), (3, 'c')]
In [280]: dict(zip(l1,l2))
Out[280]: {1: 'a', 2: 'b', 3: 'c'}

In [284]: l3 = ['I','II']#l3的长度少一个,结果也会少一个

In [285]: zip(l1,l2,l3)
Out[285]: [(1, 'a', 'I'), (2, 'b', 'II')]


3、map()返回列表,通过函数对序列相应的元素进行处理,如果需要处理一个序列,对应函数的参数是一个,如果需要处理的是两个序列,对应函数的桉树是三个,以此类推。

map(...)
    map(function, sequence[, sequence, ...]) -> list
    
    Return a list of the results of applying the function to the items of
    the argument sequence(s).  If more than one sequence is given, the
    function is called with an argument list consisting of the corresponding
    item of each sequence, substituting None for missing values when not all
    sequences have the same length.  If the function is None, return a list of
    the items of the sequence (or a list of tuples if more than one sequence).
In [287]: map(None,l1,l2,l3)
Out[287]: [(1, 'a', 'I'), (2, 'b', 'II'), (3, 'c', None)]

In [288]: def f(x):
     ...: return x**2
     ...: 
In [289]: map(f,l1)  #通过函数f对l1的每个参数处理,一个序列,对应函数的一个参数
Out[289]: [1, 4, 9]

In [294]: l1
Out[294]: [1, 2, 3]
In [290]: l2=[4,5,6]
In [292]: def f(x,y):    #定义函数,返回乘积,两个序列,对应函数的两个参数
     ...:     return x*y
     ...: 
In [293]: map(f,l1,l2) #给了两个序列,则这两个序列都会被函数f处理,并返回结果
Out[293]: [4, 10, 18]

注意:如果需要处理的是三个序列,对应函数的三个参数,以此类推。
#map使用匿名函数lambda
In [304]: map(lambda x,y: x*y,range(10),range(10))
Out[304]: [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]


4、reduce() 返回值value, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates ((((1+2)+3)+4)+5)

In [295]: help(reduce)
reduce(...)
    reduce(function, sequence[, initial]) -> value
    
    Apply a function of two arguments cumulatively to the items of a sequence,
    from left to right, so as to reduce the sequence to a single value.
    For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
    ((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
    of the sequence in the calculation, and serves as a default when the
    sequence is empty.


In [296]: def f(x,y):

     ...:     return x+y

     ...: 

In [297]: reduce(f,range(1,101))

Out[297]: 5050

#reduce使用匿名函数lambda

In [300]: reduce(lambda x,y:x+y,[1,2,3,4,5])

Out[300]: 15


5、列表表达式(列表重写)

In [305]: [i for i in range(10)]
Out[305]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

In [306]: [i*2 for i in range(10)]
Out[306]: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]

In [307]: [i**2 for i in range(10)]
Out[307]: [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]


In [308]: [i for i in range(10) if i %3==0]
Out[308]: [0, 3, 6, 9]

In [309]: [i*2 for i in range(10) if i %3==0]
Out[309]: [0, 6, 12, 18]

In [310]: [i*2+10 for i in range(10) if i %3==0]
Out[310]: [10, 16, 22, 28]


--结束END--

本文标题: python学习笔记11-python内

本文链接: https://www.lsjlt.com/news/189406.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • python学习笔记11-python内
    python学习笔记11-python内置函数一、查看python的函数介绍:https://docs.python.org/2/library/ 二、python内置函数1、abs获取绝对值:通过python官网查看absabs(x)Re...
    99+
    2023-01-31
    学习笔记 python
  • Python学习笔记
    Python介绍 Python是一种解释型、面向对象的语言。 官网:www.python.org Python环境 解释器:www.python.org/downloads 运行方式: 交互模式。在IDLE中运行。 脚本模式。文件的后缀...
    99+
    2023-01-30
    学习笔记 Python
  • Python 学习笔记
    rs=Person.objects.all() all返回的是QuerySet对象,程序并没有真的在数据库中执行SQL语句查询数据,但支持迭代,使用for循环可以获取数据。 print rs.query 会打印出原生sql语句 rs=Pe...
    99+
    2023-01-31
    学习笔记 Python
  • python学习笔记--趣学Python
    由反弹球和球拍构成的游戏。球会在屏幕上飞过来,玩家要用球拍把它弹回去 画布和画弹球 引入模块 #Tkinter -- Python的标准GUI库,Tk 接口,是python 内置的安装包 from tkinter import * i...
    99+
    2023-01-31
    学习笔记 python Python
  • Python学习笔记五(Python
    Python urllib模块提供了一个从指定的URL地址获取网页数据,然后对其进行分析处理,获取想要的数据。1.查看urllib模块提供的urlopen函数。help(urllib.urlopen) urlopen(url, data...
    99+
    2023-01-31
    学习笔记 Python
  • Python学习笔记四(Python
    Python os模块提供了一个统一的操作系统接口函数,通过python os模块可以实现对系统本身的命令,文件,目录进行操作,官方参考文档( http://docs.python.org/library/os)。1)os.sep 可以...
    99+
    2023-01-31
    学习笔记 Python
  • 【Python学习笔记】-Python中
    python中的格式为 为真时的结果 if 判定条件 else 为假时的结果 实例: print(1 if 5>3 else 0) 是先输出结果,再判定条件 输出1,如果5大于3,否则输出0 一般用于判断赋值中,例...
    99+
    2023-01-31
    学习笔记 Python
  • python——Matplotlib学习笔记
      Matplotlib是pyhon中一个强大的绘图图,可以理解为 MatLab 开源替代,鉴于MatLab的内存之大及安装之复杂,决定先学学Matplotlib这个库。  1Matplotlib的安装  window:  打开cmd,: ...
    99+
    2023-06-02
  • python-memcached学习笔记
    介绍:   memcached是免费、开源、高性能、分布式内存对象的缓存系统(键/值字典),旨在通过减轻数据库负载加快动态web应用程序的使用。   数据类型:只用一种字符串类型 1:安装 sudo apt-get install me...
    99+
    2023-01-31
    学习笔记 python memcached
  • python scrapy学习笔记
    scrapy是python最有名的爬虫框架之一,可以很方便的进行web抓取,并且提供了很强的定制型。一、安装scrapy# pip install scrapy二、基本使用1、初始化scrapy项目# scrapy startproject...
    99+
    2023-01-31
    学习笔记 python scrapy
  • Python学习笔记(1)
    1 def sum_args(*args): 2 return sum(args)) 3 4 def run_with_positional_args(func, *args): 5 return func(*...
    99+
    2023-01-31
    学习笔记 Python
  • python OpenCV学习笔记
    目录图像翻转图像轮廓排序图像轮廓排序颜色识别基础颜色识别根据BGR获取HSV阈值编辑器图像翻转 使用Python的一个包,imutils。使用下面的指令可以安装。 pip in...
    99+
    2022-11-12
  • Python学习笔记(matplotli
    Python学习笔记--在Python中如何调整颜色和样式   参靠视频:《Python数据可视化分析 matplotlib教程》链接:https://www.bilibili.com/video/av6989413/p=6 所用的库及环...
    99+
    2023-01-30
    学习笔记 Python matplotli
  • Python学习笔记-SQLSERVER
    环境 : python3.6 / win10 / vs2017 / sqlserver2017 一、需要安装的包pymssql pip install pymssql 二、pymssql模块的介绍 pymssql 包 有modules...
    99+
    2023-01-30
    学习笔记 Python SQLSERVER
  • Python学习笔记(1)
    Python开发框架:       a.Python基础;       b.网络编程;       c.WEB框架;       d.设计模式+算法;       e.项目阶段; 开发:   开发语言:       高级语言:Python...
    99+
    2023-01-30
    学习笔记 Python
  • python学习笔记(1
    关于随笔 python随笔只是个人笔记,可能会有遗漏或错误,仅供参考 学习文档地址 https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e5...
    99+
    2023-01-30
    学习笔记 python
  • Python学习笔记(二)
    学完了基础中的基础后,我们准备深入基础中的函数、类和对象。 function函数: 正如英文单词描述的,函数就是“功能”的意思,把完成一个功能所需要的代码打包起来放在一个函数下可以方便以后程序的重复调用,也能使整体代码条理清晰。正如前...
    99+
    2023-01-30
    学习笔记 Python
  • Python 学习笔记 - SQLAlc
    继续上一篇SQLAlchemy的学习之旅。多对多表的创建表Host和表HostUser通过表HostToHostUser关联在一起from sqlalchemy import create_engine from sqlalchemy.ex...
    99+
    2023-01-31
    学习笔记 Python SQLAlc
  • Python学习笔记(2)
    Unicode字符串: GB2312编码为表示中文产生 python内部编码是unicode编码Unicode通常用两个字节表示一个字符,原有的英文编码从单字节变成双字节,只需要把高字节全部填0 就可以以Unicode表示的字...
    99+
    2023-01-31
    学习笔记 Python
  • python学习笔记 --- prin
    print 输出直接到文件里主要是python版本问题,语法不一样,这里记录一下。 python 3.x #!/usr/bin/env python3 #coding:utf-8 K = 10 f = open("./output/r...
    99+
    2023-01-31
    学习笔记 python prin
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作