博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Python List Pop
阅读量:4029 次
发布时间:2019-05-24

本文共 501 字,大约阅读时间需要 1 分钟。

Syntax

Following is the syntax for pop() method −

list.pop(obj=list[-1])

Parameters

  • obj -- This is an optional parameter, index of the object to be removed from the list.

Return Value

This method returns the removed object from the list.

Example

The following example shows the usage of pop() method.

#!/usr/bin/pythonaList = [123, 'xyz', 'zara', 'abc'];print "A List : ", aList.pop()print "B List : ", aList.pop(2)

When we run above program, it produces following result −

A List :  abcB List :  zara

转载地址:http://yshbi.baihongyu.com/

你可能感兴趣的文章
android中shader的使用
查看>>
java LinkedList与ArrayList迭代器遍历和for遍历对比
查看>>
Android DataBinding使用2-Recycleview
查看>>
drat中构造方法
查看>>
JavaScript的一些基础-数据类型
查看>>
JavaScript基础知识(2)
查看>>
转载一个webview开车指南以及实际项目中的使用
查看>>
android中对于非属性动画的整理
查看>>
一个简单的TabLayout的使用
查看>>
关于let{a}=B出现的解构赋值
查看>>
ReactNative使用Redux例子
查看>>
Promise的基本使用
查看>>
android给文字加边框(修改不能居中的问题)
查看>>
coursesa课程 Python 3 programming 统计文件有多少单词
查看>>
coursesa课程 Python 3 programming 输出每一行句子的第三个单词
查看>>
coursesa课程 Python 3 programming Dictionary methods 字典的方法
查看>>
Returning a value from a function
查看>>
coursesa课程 Python 3 programming Functions can call other functions 函数调用另一个函数
查看>>
coursesa课程 Python 3 programming The while Statement
查看>>
course_2_assessment_6
查看>>