SlideShare a Scribd company logo
ASET Amity University, Noida
Python
Assignment-1
2021-2022
5 CSE 9Y
Submitted By: Shivam
Tripathi
(A2305219629)
Guided By: Neetu Mam
ANSWERS
A-1 Lists are used to store multiple items in a
single variable. Lists are created using square
brackets: list = ["apple", "banana", "cherry"].
append(): Adds an element at the end of the
list.
clear(): Removes all the elements from the list.
copy(): Returns a copy of the list.
count(): Returns the number of elements with
the specified value.
extend(): Add the elements of a list to the end
of the current list.
index(): Returns the index of the first element
with the specified value.
insert(): Adds an element at the specified
position.
pop(): Removes the element at the specified
position.
reverse(): Reverses the order of the list.
sort(): Sorts the list.
A-2:
1. The split() method splits a string into a list.
Ex:
2. A slice object is used to specify how to slice
a sequence. You can specify where to start
the slicing, and where to end.
3. The strip() method removes any leading
(spaces at the beginning) and trailing
(spaces at the end) characters (space is
the default leading character to remove)

More Related Content

PDF
Python set
PDF
Python List Comprehensions
PPTX
Insertion operation in array(ds)
PPTX
Python PCEP Lists Collections of Data
PPTX
Dictionaries and Sets in Python
PDF
Python list
PPTX
List in Python
Python set
Python List Comprehensions
Insertion operation in array(ds)
Python PCEP Lists Collections of Data
Dictionaries and Sets in Python
Python list
List in Python

What's hot (20)

PPTX
F# array searching
PPTX
LIST IN PYTHON
PPTX
Array vs array list
PDF
Data type list_methods_in_python
PPTX
Python list
PPTX
ArrayList in JAVA
PDF
Billing Software By Harsh Mathur.
PPT
Python session 10
PDF
Arrays in python
PDF
Problem Solving with Algorithms and Data Structure - Lists
PDF
Chapter 20 generic collections
PPTX
Data structure
PDF
Set methods in python
PPTX
Java arrays
PPTX
Chapter 17 Tuples
PPTX
Data Structures in Python
DOCX
linkedin_notes
PPTX
16 containers
F# array searching
LIST IN PYTHON
Array vs array list
Data type list_methods_in_python
Python list
ArrayList in JAVA
Billing Software By Harsh Mathur.
Python session 10
Arrays in python
Problem Solving with Algorithms and Data Structure - Lists
Chapter 20 generic collections
Data structure
Set methods in python
Java arrays
Chapter 17 Tuples
Data Structures in Python
linkedin_notes
16 containers
Ad

Similar to Python Assignment 1 Answers (1).docx (20)

PPTX
Python _dataStructures_ List, Tuples, its functions
PPTX
Basic data structures in python
PPTX
Chapter 15 Lists
PDF
LinkedList1LinkedList1LinkedList1111.pdf
PPTX
Python programming Part -6
PDF
Prompt Your task is to create a connected list implementation and .pdf
PPTX
Unit 4 python -list methods
PPTX
Chapter 3-Data structure in python programming.pptx
PPTX
PYTHON-PROGRAMMING-UNIT-III.pptx kghbg kfhjf jruufg jtuuf
PPT
linked list (c#)
PPTX
Python for the data science most in cse.pptx
PPTX
list in python and traversal of list.pptx
PDF
STAGE 2 The Methods 65 points Implement all the methods t.pdf
PDF
Hi,I have added the methods and main class as per your requirement.pdf
PPT
Collection Framework.power point presentation.......
PDF
Objective The purpose of this exercise is to create a Linke.pdf
PDF
Objective The purpose of this exercise is to create a Linke.pdf
PDF
The LinkedList1 class implements a Linked list. class.pdf
Python _dataStructures_ List, Tuples, its functions
Basic data structures in python
Chapter 15 Lists
LinkedList1LinkedList1LinkedList1111.pdf
Python programming Part -6
Prompt Your task is to create a connected list implementation and .pdf
Unit 4 python -list methods
Chapter 3-Data structure in python programming.pptx
PYTHON-PROGRAMMING-UNIT-III.pptx kghbg kfhjf jruufg jtuuf
linked list (c#)
Python for the data science most in cse.pptx
list in python and traversal of list.pptx
STAGE 2 The Methods 65 points Implement all the methods t.pdf
Hi,I have added the methods and main class as per your requirement.pdf
Collection Framework.power point presentation.......
Objective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdf
The LinkedList1 class implements a Linked list. class.pdf
Ad

Recently uploaded (20)

PDF
III.4.1.2_The_Space_Environment.p pdffdf
PDF
737-MAX_SRG.pdf student reference guides
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Geodesy 1.pptx...............................................
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Artificial Intelligence
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PPTX
Construction Project Organization Group 2.pptx
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
DOCX
573137875-Attendance-Management-System-original
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
Internet of Things (IOT) - A guide to understanding
III.4.1.2_The_Space_Environment.p pdffdf
737-MAX_SRG.pdf student reference guides
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Geodesy 1.pptx...............................................
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Artificial Intelligence
Fundamentals of safety and accident prevention -final (1).pptx
Construction Project Organization Group 2.pptx
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
573137875-Attendance-Management-System-original
R24 SURVEYING LAB MANUAL for civil enggi
Internet of Things (IOT) - A guide to understanding

Python Assignment 1 Answers (1).docx

  • 1. ASET Amity University, Noida Python Assignment-1 2021-2022 5 CSE 9Y Submitted By: Shivam Tripathi (A2305219629) Guided By: Neetu Mam
  • 2. ANSWERS A-1 Lists are used to store multiple items in a single variable. Lists are created using square brackets: list = ["apple", "banana", "cherry"]. append(): Adds an element at the end of the list. clear(): Removes all the elements from the list. copy(): Returns a copy of the list. count(): Returns the number of elements with the specified value. extend(): Add the elements of a list to the end of the current list. index(): Returns the index of the first element with the specified value. insert(): Adds an element at the specified position. pop(): Removes the element at the specified position. reverse(): Reverses the order of the list. sort(): Sorts the list.
  • 3. A-2: 1. The split() method splits a string into a list. Ex: 2. A slice object is used to specify how to slice a sequence. You can specify where to start the slicing, and where to end. 3. The strip() method removes any leading (spaces at the beginning) and trailing (spaces at the end) characters (space is the default leading character to remove)