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

我来说两句

我的栏目

日历

« 2021-12-22  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 2865
  • 日志数: 9
  • 建立时间: 2017-12-06
  • 更新时间: 2019-10-12

RSS订阅

Open Toolbar