python常用函数

1. String Functions 字符串函数

join -- joins a list of strings with anotherstring as a separator.

replace -- replaces onesubstring in a string with another.

startswith and endswith -- determineif there is a substring at the start and end of a string,respectively.

lower/upper -- to change the case of a string

split -- the opposite of join, turning a stringwith a certain separator into a list.

some examples:

2. Numeric Functions 数值函数

max -- find the maximum number in a list

min -- find the minimum number in a list

abs -- find the distance of a number from zero (its absolute value)

round --to round a number to a certain number of decimal places.

sum -- caculate the total of a list

some examples:

3. List Functions 列表函数

Often used in conditional statements.

all/any -- take a list as an argument,return True if all/any arguments evaluate to True.

enumerate -- can be used to iterate through the values and indices of a list simultaneously.

some examples:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值