Python学习日志【第二章】 (四)

上一篇 / 下一篇  2018-01-11 17:20:56 / 个人分类:学习

numbers=[12,23,34,22,11,23,44,567]
print('numbers=')
print(numbers)
print('numbers.index(12)=')
print(numbers.index(22))
print('numbers.insert(2,\'two\')')
print(numbers.insert(2,'two'))
print('numbers=')
print(numbers)
print('numbers.pop()')
print(numbers.pop())
print('numbers=')
print(numbers)
print('numbers.append(\'end\')=')
print(numbers.append('end'))
print('numbers=')
print(numbers)
print('numbers.remove(23)=')
print(numbers.remove(23))
print(numbers)
print('numbers.reverse()')
print(numbers.reverse())
print(numbers)
numbers2=numbers[1:5]
print(numbers2)
print('numbers2.sort()')
print(numbers2.sort())
print(numbers2)
print('sorted(numbers[1:5])')
ynumbers=sorted(numbers[1:5])
print(ynumbers)
print('sorted(\'python\')')
print(sorted('python'))
x=['adfv','sdf','sdfasdfwe','qewfasd','adf','a']
print('x.sort(key=len)=')
print(x.sort(key=len))
print('x=')
print(x)


TAG: 学习

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

我的栏目

日历

« 2018-07-11  
1234567
891011121314
15161718192021
22232425262728
293031    

数据统计

  • 访问量: 886
  • 日志数: 6
  • 建立时间: 2017-12-06
  • 更新时间: 2018-02-05

RSS订阅

Open Toolbar