Python

Python Menu

Definition

The pop() method removes the element at the specified position.

Syntax

list.pop(pos)

Parameters

Parameter Description
pos Optional. A number specifying the position of the element you want to remove, default value is -1, which returns the last item

Examples:

cars = ['Nissan', 'Ford', 'Volkswagen'] j = cars.pop(1) print(j)

Introduction

Python Basics

Python Advance

Data Science Python Tutorials

Python Functions and Methods