SlideShare a Scribd company logo
1/8
PROGRAM TO CREATE A LIST IN PYTHON AND
VALUES OF LIST WILL BE TAKEN AS INPUT
torchbearersnotebook.blogspot.com/2021/07/program-to-create-list-in-python-and.html
TO CREATE A LIST OF FRUITS AND TAKE FRUITS AS INPUT WRITE THE
PROGRAM GIVEN BELOW:
print("Enter fruit number 1:")
a = input()
print(a)
print("Enter fruit number 2:")
b = input()
print(b)
print("Enter fruit number 3:")
c = input()
print(c)
print("Enter fruit number 4:")
d = input()
print(d)
print("Enter fruit number 5:")
e = input()
print(e)
print("Enter fruit number 6:")
f = input()
print(f)
2/8
PROGRAM TO ADD AN ELEMENT AT THE END OF A LIST:
print("Enter fruit number 1:")
a = input()
print(a)
print("Enter fruit number 2:")
b = input()
print(b)
print("Enter fruit number 3:")
c = input()
print(c)
print("Enter fruit number 4:")
d = input()
print(d)
print("Enter fruit number 5:")
e = input()
3/8
print(e)
print("Enter fruit number 6:")
f = input()
print(f)
print("Enter fruit number 7:")
g = input()
print(g)
myfruitlist=[a, b, c, d, e, f]
print(myfruitlist)
myfruitlist.append(g)
print(myfruitlist)
PROGRAM TO ADD AN ELEMENT AT A PARTICULAR INDEXING OF A LIST:
print("Enter fruit number 1:")
a = input()
print(a)
print("Enter fruit number 2:")
b = input()
print(b)
print("Enter fruit number 3:")
4/8
c = input()
print(c)
print("Enter fruit number 4:")
d = input()
print(d)
print("Enter fruit number 5:")
e = input()
print(e)
print("Enter fruit number 6:")
f = input()
print(f)
print("Enter fruit number 7:")
g = input()
print(g)
print("Enter fruit number 8:")
h = input()
print(h)
myfruitlist=[a, b, c, d, e, f, g]
print(myfruitlist)
myfruitlist.insert(6,h)
print(myfruitlist)
5/8
PROGRAM THAT REMOVES AND RETURNS THE LAST VALUE FROM THE
GIVEN LIST OR THE GIVEN INDEX:
print("Enter fruit number 1:")
a = input()
print(a)
print("Enter fruit number 2:")
b = input()
print(b)
print("Enter fruit number 3:")
c = input()
print(c)
print("Enter fruit number 4:")
d = input()
print(d)
print("Enter fruit number 5:")
e = input()
print(e)
print("Enter fruit number 6:")
f = input()
6/8
print(f)
print("Enter fruit number 7:")
g = input()
print(g)
print("Enter fruit number 8:")
h = input()
print(h)
myfruitlist=[a, b, c, d, e, f, g, h]
print(myfruitlist)
myfruitlist.pop()
print(myfruitlist)
PROGRAM THAT REMOVES A PARTICULAR ELEMENT FROM YOUR LIST:
print("Enter fruit number 1:")
a = input()
print(a)
print("Enter fruit number 2:")
7/8
b = input()
print(b)
print("Enter fruit number 3:")
c = input()
print(c)
print("Enter fruit number 4:")
d = input()
print(d)
print("Enter fruit number 5:")
e = input()
print(e)
print("Enter fruit number 6:")
f = input()
print(f)
print("Enter fruit number 7:")
g = input()
print(g)
print("Enter fruit number 8:")
h = input()
print(h)
myfruitlist=[a, b, c, d, e, f, g, h]
print(myfruitlist)
myfruitlist.remove(b)
print(myfruitlist)
8/8

More Related Content

What's hot

8.1
8.18.1
week-2x
week-2xweek-2x
C Programming Language Part 4
C Programming Language Part 4C Programming Language Part 4
C Programming Language Part 4
Rumman Ansari
 
Array list
Array listArray list
PyParis2017 / Incremental computation in python, by Philip Schanely
PyParis2017 / Incremental computation in python, by Philip SchanelyPyParis2017 / Incremental computation in python, by Philip Schanely
PyParis2017 / Incremental computation in python, by Philip Schanely
Pôle Systematic Paris-Region
 
C언어 스터디 강의자료 - 1차시
C언어 스터디 강의자료 - 1차시C언어 스터디 강의자료 - 1차시
C언어 스터디 강의자료 - 1차시
Junha Jang
 
Python basic Program
Python basic ProgramPython basic Program
Python basic Program
nuripatidar
 
Applications of stack
Applications of stackApplications of stack
Applications of stack
A. S. M. Shafi
 
week-4x
week-4xweek-4x
Stack Data Structure
Stack Data StructureStack Data Structure
Stack Data Structure
Er. Ganesh Ram Suwal
 
array implementation
 array implementation array implementation
array implementation
Sathya Ds
 
#2
#2#2
week-11x
week-11xweek-11x
01 list using array
01 list using array01 list using array
01 list using array
SivakamiRaja1
 
ML: A Strongly Typed Functional Language
ML: A Strongly Typed Functional LanguageML: A Strongly Typed Functional Language
ML: A Strongly Typed Functional Language
lijx127
 
week-1x
week-1xweek-1x
DS- Stack ADT
DS- Stack ADTDS- Stack ADT
DS- Stack ADT
MythiliMurugan3
 
Array imp of list
Array imp of listArray imp of list
Array imp of list
Elavarasi K
 
Generators
GeneratorsGenerators
Generators
amalagon00
 
week-10x
week-10xweek-10x

What's hot (20)

8.1
8.18.1
8.1
 
week-2x
week-2xweek-2x
week-2x
 
C Programming Language Part 4
C Programming Language Part 4C Programming Language Part 4
C Programming Language Part 4
 
Array list
Array listArray list
Array list
 
PyParis2017 / Incremental computation in python, by Philip Schanely
PyParis2017 / Incremental computation in python, by Philip SchanelyPyParis2017 / Incremental computation in python, by Philip Schanely
PyParis2017 / Incremental computation in python, by Philip Schanely
 
C언어 스터디 강의자료 - 1차시
C언어 스터디 강의자료 - 1차시C언어 스터디 강의자료 - 1차시
C언어 스터디 강의자료 - 1차시
 
Python basic Program
Python basic ProgramPython basic Program
Python basic Program
 
Applications of stack
Applications of stackApplications of stack
Applications of stack
 
week-4x
week-4xweek-4x
week-4x
 
Stack Data Structure
Stack Data StructureStack Data Structure
Stack Data Structure
 
array implementation
 array implementation array implementation
array implementation
 
#2
#2#2
#2
 
week-11x
week-11xweek-11x
week-11x
 
01 list using array
01 list using array01 list using array
01 list using array
 
ML: A Strongly Typed Functional Language
ML: A Strongly Typed Functional LanguageML: A Strongly Typed Functional Language
ML: A Strongly Typed Functional Language
 
week-1x
week-1xweek-1x
week-1x
 
DS- Stack ADT
DS- Stack ADTDS- Stack ADT
DS- Stack ADT
 
Array imp of list
Array imp of listArray imp of list
Array imp of list
 
Generators
GeneratorsGenerators
Generators
 
week-10x
week-10xweek-10x
week-10x
 

Similar to Torchbearersnotebook.blogspot.com program to create a list in python and values of list will be taken as input (1)

Maths with Programming
Maths with ProgrammingMaths with Programming
Maths with Programming
Omar Bashir
 
10〜30分で何となく分かるGo
10〜30分で何となく分かるGo10〜30分で何となく分かるGo
10〜30分で何となく分かるGo
Moriyoshi Koizumi
 
Let's golang
Let's golangLet's golang
Let's golang
SuHyun Jeon
 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3
Abdul Haseeb
 
Xi CBSE Computer Science lab programs
Xi CBSE Computer Science lab programsXi CBSE Computer Science lab programs
Xi CBSE Computer Science lab programs
Prof. Dr. K. Adisesha
 
An introduction to functional programming with go
An introduction to functional programming with goAn introduction to functional programming with go
An introduction to functional programming with go
Eleanor McHugh
 
Python programming workshop session 4
Python programming workshop session 4Python programming workshop session 4
Python programming workshop session 4
Abdul Haseeb
 
python programs .docx
python programs .docxpython programs .docx
python programs .docx
AnonymousRuslwNZZl
 
Assignment6
Assignment6Assignment6
Assignment6
Ryan Gogats
 
Python programs - first semester computer lab manual (polytechnics)
Python programs - first semester computer lab manual (polytechnics)Python programs - first semester computer lab manual (polytechnics)
Python programs - first semester computer lab manual (polytechnics)
SHAMJITH KM
 
Write an algorithm for a program that shows the use of all six math fu.docx
Write an algorithm for a program that shows the use of all six math fu.docxWrite an algorithm for a program that shows the use of all six math fu.docx
Write an algorithm for a program that shows the use of all six math fu.docx
karlynwih
 
I really need help with this Assignment Please in C programming not .pdf
I really need help with this Assignment Please in C programming not .pdfI really need help with this Assignment Please in C programming not .pdf
I really need help with this Assignment Please in C programming not .pdf
pasqualealvarez467
 
Data Structure using C
Data Structure using CData Structure using C
Data Structure using C
Bilal Mirza
 
Python program For O level Practical
Python program For O level Practical Python program For O level Practical
Python program For O level Practical
pavitrakumar18
 
Python programs - PPT file (Polytechnics)
Python programs - PPT file (Polytechnics)Python programs - PPT file (Polytechnics)
Python programs - PPT file (Polytechnics)
SHAMJITH KM
 
Simple C programs
Simple C programsSimple C programs
Simple C programs
ab11cs001
 
notes.pdf
notes.pdfnotes.pdf
notes.pdf
Anant Mehrotra
 
xii cs practicals
xii cs practicalsxii cs practicals
xii cs practicals
JaswinderKaurSarao
 
7 Python udf.pptx
7 Python udf.pptx7 Python udf.pptx
7 Python udf.pptx
SUJALORAON
 
Programas Gambas
Programas GambasProgramas Gambas
Programas Gambas
Stalin Rodriguez
 

Similar to Torchbearersnotebook.blogspot.com program to create a list in python and values of list will be taken as input (1) (20)

Maths with Programming
Maths with ProgrammingMaths with Programming
Maths with Programming
 
10〜30分で何となく分かるGo
10〜30分で何となく分かるGo10〜30分で何となく分かるGo
10〜30分で何となく分かるGo
 
Let's golang
Let's golangLet's golang
Let's golang
 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3
 
Xi CBSE Computer Science lab programs
Xi CBSE Computer Science lab programsXi CBSE Computer Science lab programs
Xi CBSE Computer Science lab programs
 
An introduction to functional programming with go
An introduction to functional programming with goAn introduction to functional programming with go
An introduction to functional programming with go
 
Python programming workshop session 4
Python programming workshop session 4Python programming workshop session 4
Python programming workshop session 4
 
python programs .docx
python programs .docxpython programs .docx
python programs .docx
 
Assignment6
Assignment6Assignment6
Assignment6
 
Python programs - first semester computer lab manual (polytechnics)
Python programs - first semester computer lab manual (polytechnics)Python programs - first semester computer lab manual (polytechnics)
Python programs - first semester computer lab manual (polytechnics)
 
Write an algorithm for a program that shows the use of all six math fu.docx
Write an algorithm for a program that shows the use of all six math fu.docxWrite an algorithm for a program that shows the use of all six math fu.docx
Write an algorithm for a program that shows the use of all six math fu.docx
 
I really need help with this Assignment Please in C programming not .pdf
I really need help with this Assignment Please in C programming not .pdfI really need help with this Assignment Please in C programming not .pdf
I really need help with this Assignment Please in C programming not .pdf
 
Data Structure using C
Data Structure using CData Structure using C
Data Structure using C
 
Python program For O level Practical
Python program For O level Practical Python program For O level Practical
Python program For O level Practical
 
Python programs - PPT file (Polytechnics)
Python programs - PPT file (Polytechnics)Python programs - PPT file (Polytechnics)
Python programs - PPT file (Polytechnics)
 
Simple C programs
Simple C programsSimple C programs
Simple C programs
 
notes.pdf
notes.pdfnotes.pdf
notes.pdf
 
xii cs practicals
xii cs practicalsxii cs practicals
xii cs practicals
 
7 Python udf.pptx
7 Python udf.pptx7 Python udf.pptx
7 Python udf.pptx
 
Programas Gambas
Programas GambasProgramas Gambas
Programas Gambas
 

Recently uploaded

Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 

Recently uploaded (20)

Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 

Torchbearersnotebook.blogspot.com program to create a list in python and values of list will be taken as input (1)

  • 1. 1/8 PROGRAM TO CREATE A LIST IN PYTHON AND VALUES OF LIST WILL BE TAKEN AS INPUT torchbearersnotebook.blogspot.com/2021/07/program-to-create-list-in-python-and.html TO CREATE A LIST OF FRUITS AND TAKE FRUITS AS INPUT WRITE THE PROGRAM GIVEN BELOW: print("Enter fruit number 1:") a = input() print(a) print("Enter fruit number 2:") b = input() print(b) print("Enter fruit number 3:") c = input() print(c) print("Enter fruit number 4:") d = input() print(d) print("Enter fruit number 5:") e = input() print(e) print("Enter fruit number 6:") f = input() print(f)
  • 2. 2/8 PROGRAM TO ADD AN ELEMENT AT THE END OF A LIST: print("Enter fruit number 1:") a = input() print(a) print("Enter fruit number 2:") b = input() print(b) print("Enter fruit number 3:") c = input() print(c) print("Enter fruit number 4:") d = input() print(d) print("Enter fruit number 5:") e = input()
  • 3. 3/8 print(e) print("Enter fruit number 6:") f = input() print(f) print("Enter fruit number 7:") g = input() print(g) myfruitlist=[a, b, c, d, e, f] print(myfruitlist) myfruitlist.append(g) print(myfruitlist) PROGRAM TO ADD AN ELEMENT AT A PARTICULAR INDEXING OF A LIST: print("Enter fruit number 1:") a = input() print(a) print("Enter fruit number 2:") b = input() print(b) print("Enter fruit number 3:")
  • 4. 4/8 c = input() print(c) print("Enter fruit number 4:") d = input() print(d) print("Enter fruit number 5:") e = input() print(e) print("Enter fruit number 6:") f = input() print(f) print("Enter fruit number 7:") g = input() print(g) print("Enter fruit number 8:") h = input() print(h) myfruitlist=[a, b, c, d, e, f, g] print(myfruitlist) myfruitlist.insert(6,h) print(myfruitlist)
  • 5. 5/8 PROGRAM THAT REMOVES AND RETURNS THE LAST VALUE FROM THE GIVEN LIST OR THE GIVEN INDEX: print("Enter fruit number 1:") a = input() print(a) print("Enter fruit number 2:") b = input() print(b) print("Enter fruit number 3:") c = input() print(c) print("Enter fruit number 4:") d = input() print(d) print("Enter fruit number 5:") e = input() print(e) print("Enter fruit number 6:") f = input()
  • 6. 6/8 print(f) print("Enter fruit number 7:") g = input() print(g) print("Enter fruit number 8:") h = input() print(h) myfruitlist=[a, b, c, d, e, f, g, h] print(myfruitlist) myfruitlist.pop() print(myfruitlist) PROGRAM THAT REMOVES A PARTICULAR ELEMENT FROM YOUR LIST: print("Enter fruit number 1:") a = input() print(a) print("Enter fruit number 2:")
  • 7. 7/8 b = input() print(b) print("Enter fruit number 3:") c = input() print(c) print("Enter fruit number 4:") d = input() print(d) print("Enter fruit number 5:") e = input() print(e) print("Enter fruit number 6:") f = input() print(f) print("Enter fruit number 7:") g = input() print(g) print("Enter fruit number 8:") h = input() print(h) myfruitlist=[a, b, c, d, e, f, g, h] print(myfruitlist) myfruitlist.remove(b) print(myfruitlist)
  • 8. 8/8