Python学习笔记---元组、序列

(1,2,3,4,5)
(1,'a',True)
(1,'a',True)*3
(1,2,3,4,5)[0]
(1,2,3,4,5)[0:2]
(1,2,3,4,5)+(1,2,3,4,5)
type((1,2,3))#Out[7]: tuple元组
type(1)#Out[9]: int
type((1))#Out[9]: int
type((1,))#Out[16]: tuple
type(())#Out[17]: tuple
type([1,2,33])#Out[11]: list
type([1])#Out[18]: list
type('hello')#Out[14]: str
print(type('hello'))#<class 'str'>
#class类
#########int,float,bool
#########str,list,tuple,序列
######序列通用操作
'hello me word'[-7:-5]#Out[20]: 'me'
#+,*
'a' in ['a','b','c','d','e']#Out[24]: True
'f' in ['a','b','c','d','e']#Out[23]: False
'a' not in ['a','b','c','d','e']#Out[22]: False
len(['a','b','c','d','e'])#列表长度Out[25]: 5
len('abcdef')#Out[29]: 6
max([1,2,3,4,5,6])#Out[27]: 6
min([1,2,3,4,5,6])#Out[28]: 1
max('abcdef')#Out[30]: 'f'
min('abcdef')#Out[31]: 'a'
min('abc def')#Out[32]: ' '
#####ascll码
ord(' ')
ord('a')
ord('z')

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值