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
Ad

More Related Content

What's hot (20)

8.1
8.18.1
8.1
namthip2539
 
week-2x
week-2xweek-2x
week-2x
KITE www.kitecolleges.com
 
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
Array list
cvr college of engineering
 
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
week-4x
KITE www.kitecolleges.com
 
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
#2
Kaido Iwamoto
 
week-11x
week-11xweek-11x
week-11x
KITE www.kitecolleges.com
 
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
week-1x
KITE www.kitecolleges.com
 
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
week-10x
KITE www.kitecolleges.com
 

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
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
 
xii cs practicals class 12 computer science.pdf
xii cs practicals class 12 computer science.pdfxii cs practicals class 12 computer science.pdf
xii cs practicals class 12 computer science.pdf
gmaiihghtg
 
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
 
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
 
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
 
xii cs practicals class 12 computer science.pdf
xii cs practicals class 12 computer science.pdfxii cs practicals class 12 computer science.pdf
xii cs practicals class 12 computer science.pdf
gmaiihghtg
 
Python programming workshop session 4
Python programming workshop session 4Python programming workshop session 4
Python programming workshop session 4
Abdul Haseeb
 
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
 
7 Python udf.pptx
7 Python udf.pptx7 Python udf.pptx
7 Python udf.pptx
SUJALORAON
 
Ad

Recently uploaded (20)

Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Ad

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