PDA Assignments
  • Python For Data Analytics
    • 1.Python
      • 1.Python Documents
        • 1.Data Types
        • 2.Variables In Python
        • 3.Operators In Python
        • 4.User Input In Python
        • 5.TypeCasting In Python
        • 6.Strings In Python
        • 7.Conditional Statements In Python
        • 8.Branching using Conditional Statements and Loops in Python
        • 9.Lists In Python
        • 10.Sets In Python
        • 11.Tuples In Python
        • 12.Dictionary In Python
        • 13.Functions In Python
        • 14.File Handling In Python
        • 15.Numerical Computing with Python and Numpy
      • 2.Python Assignments
        • Data Type & Variables
        • Operators Assignment
        • User Input & Type Casting
        • Functions- Basic Assignments
        • String Assignments
          • String CheatSheet
        • Conditional Statements Assignments
        • Loops Assignments
        • List Assignments
          • List Cheatsheet
        • Set Assignments
          • Sets Cheatsheet
        • Dictionary Assignments
          • Dictionary Cheatsheet
        • Function Assignments
        • Functions used in Python
      • 3.Python Projects
        • Employee Management System
        • Hamming distance
        • Webscraping With Python
          • Introduction To Web Scraping
          • Importing Necessary Libraries
          • Basic Introduction To HTML
          • Introduction To BeautifulSoup
          • Flipkart Web Scraping
            • Scraping Step By Step
        • Retail Sales Analysis
        • Guess the Word Game
        • Data Collection Through APIs
        • To-Do List Manager
        • Atm-functionalities(nested if)
        • Distribution of Cards(List & Nested for)
        • Guess the Number Game
      • 4.Python + SQL Projects
        • Bookstore Management System
    • 2.Data Analytics
      • 1.Pandas
        • 1.Pandas Documents
          • 1.Introduction To Pandas
          • Reading and Loading Different Data
          • 2.Indexing and Slicing In Pandas
          • 3.Joining In Pandas
          • 4.Missing Values In Pandas
          • 5.Outliers In Pandas
          • 6.Aggregating Data
          • 7.DateTime In Pandas
          • 8.Validation In Pandas
          • 9.Fetching Data From SQL
          • 10. Automation In Pandas
          • 11.Matplotlib - Data Visualization
          • 12. Seaborn - Data Visualization
          • 13. Required Files
        • 3.Pandas Projects
          • Retail Sales Analysis
            • Retail Sales Step By Step
          • IMDB - Dataset Analysis - Basic
        • 2. Pandas Assignments
          • 1. Reading and Loading the Data
          • 2. Data frame Functions and Properties
          • 3. Series - Basic Operations
          • 4. Filtering in Pandas
          • 5. Advance Filtering
          • 6. Aggregate Functions & Groupby
          • 7. Pivot Tables
          • 8. Datetime
          • 9. String Functions
Powered by GitBook
On this page
  1. Python For Data Analytics
  2. 1.Python
  3. 2.Python Assignments
  4. List Assignments

List Cheatsheet

  1. .append(item): To add an item in a list. l1=[12,23,34,56] l1.append(3.14) # [12,23,34,56,3.14]

  2. .extend(list): To add a list in a list l1=[12,23,34,56] l2=['a','b','c'] # [12,23,34,56,'a','b','c']

  3. .insert(index,item): To add an item at a particular index in a list l1=[12,23,34,56] l1.insert(2,420) # [12,23,420,34,56]

  4. .remove(item): To remove an item from the list l1=[12,23,34,56] l1.remove(34) # [12,23,56]

  5. .pop(index): To remove an item fromt the list on behalf of index number l1=[12,23,34,56] l1.pop(1) # [12,34,56]

  6. .index(item): It provides the index number of an item. l1=[12,23,34,56] l1.index(23) # 1

  7. .count(item): It provide the counting of an item in a list l1=[12,23,34,56,34,34] l1.count(34) # 3

  8. .sort(): It arranges the items of a list in an ascending order l1=[90,121,1,2,23,34,5,6] l1.sort() # [1,2,5,6,23,34,90,121]

  9. .reverse(): It reverse the items from first to last in a list l1=[90,121,1,2,23,34,5,6] l1.reverse() # [6,5,34,23,2,1,121,90]

  10. .copy(): It copies item of one list to another list l1=[90,121,1,2,23,34,5,6] l2=l1.copy() # [90,121,1,2,23,34,5,6]

  11. .clear(): It removes all the items of a list in one go. l1=[90,121,1,2,23,34,5,6] l1.clear() # []

PreviousList AssignmentsNextSet Assignments

Last updated 1 year ago