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

Recommended

week-15x
week-15x
KITE www.kitecolleges.com
 
StackArray stack3
StackArray stack3
Rajendran
 
Stack using Linked List
Stack using Linked List
Sayantan Sur
 
Array menu
Array menu
Sayantan Sur
 
Stack using Array
Stack using Array
Sayantan Sur
 
Codemania101: The Present, Past and Future of Asynchronous Programming in Python
Codemania101: The Present, Past and Future of Asynchronous Programming in Python
Yothin Muangsommuk
 
5 Rmi Print
5 Rmi Print
varadasuren
 
Cpl
Cpl
Ayesha Shariff
 
8.1
8.1
namthip2539
 
week-2x
week-2x
KITE www.kitecolleges.com
 
C Programming Language Part 4
C Programming Language Part 4
Rumman Ansari
 
Array list
Array list
cvr college of engineering
 
PyParis2017 / Incremental computation in python, by Philip Schanely
PyParis2017 / Incremental computation in python, by Philip Schanely
Pôle Systematic Paris-Region
 
C언어 스터디 강의자료 - 1차시
C언어 스터디 강의자료 - 1차시
Junha Jang
 
Python basic Program
Python basic Program
nuripatidar
 
Applications of stack
Applications of stack
A. S. M. Shafi
 
week-4x
week-4x
KITE www.kitecolleges.com
 
Stack Data Structure
Stack Data Structure
Er. Ganesh Ram Suwal
 
array implementation
array implementation
Sathya Ds
 
#2
#2
Kaido Iwamoto
 
week-11x
week-11x
KITE www.kitecolleges.com
 
01 list using array
01 list using array
SivakamiRaja1
 
ML: A Strongly Typed Functional Language
ML: A Strongly Typed Functional Language
lijx127
 
week-1x
week-1x
KITE www.kitecolleges.com
 
DS- Stack ADT
DS- Stack ADT
MythiliMurugan3
 
Array imp of list
Array imp of list
Elavarasi K
 
Generators
Generators
amalagon00
 
week-10x
week-10x
KITE www.kitecolleges.com
 
list and control statement.pptx
list and control statement.pptx
ssuser8f0410
 
Introduction To Programming with Python-4
Introduction To Programming with Python-4
Syed Farjad Zia Zaidi
 

More Related Content

What's hot (20)

8.1
8.1
namthip2539
 
week-2x
week-2x
KITE www.kitecolleges.com
 
C Programming Language Part 4
C Programming Language Part 4
Rumman Ansari
 
Array list
Array list
cvr college of engineering
 
PyParis2017 / Incremental computation in python, by Philip Schanely
PyParis2017 / Incremental computation in python, by Philip Schanely
Pôle Systematic Paris-Region
 
C언어 스터디 강의자료 - 1차시
C언어 스터디 강의자료 - 1차시
Junha Jang
 
Python basic Program
Python basic Program
nuripatidar
 
Applications of stack
Applications of stack
A. S. M. Shafi
 
week-4x
week-4x
KITE www.kitecolleges.com
 
Stack Data Structure
Stack Data Structure
Er. Ganesh Ram Suwal
 
array implementation
array implementation
Sathya Ds
 
#2
#2
Kaido Iwamoto
 
week-11x
week-11x
KITE www.kitecolleges.com
 
01 list using array
01 list using array
SivakamiRaja1
 
ML: A Strongly Typed Functional Language
ML: A Strongly Typed Functional Language
lijx127
 
week-1x
week-1x
KITE www.kitecolleges.com
 
DS- Stack ADT
DS- Stack ADT
MythiliMurugan3
 
Array imp of list
Array imp of list
Elavarasi K
 
Generators
Generators
amalagon00
 
week-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)

list and control statement.pptx
list and control statement.pptx
ssuser8f0410
 
Introduction To Programming with Python-4
Introduction To Programming with Python-4
Syed Farjad Zia Zaidi
 
Python Collection datatypes
Python Collection datatypes
Adheetha O. V
 
powerpoint 2-13.pptx
powerpoint 2-13.pptx
JuanPicasso7
 
PE1 Module 3.ppt
PE1 Module 3.ppt
balewayalew
 
Python programming
Python programming
sirikeshava
 
GE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_Notes
Guru Nanak Technical Institutions
 
python_lab_manual_final (1).pdf
python_lab_manual_final (1).pdf
keerthu0442
 
ANSHUL RANA - PROGRAM FILE.pptx
ANSHUL RANA - PROGRAM FILE.pptx
jeyel85227
 
xii cs practicals
xii cs practicals
JaswinderKaurSarao
 
Python.pptx
Python.pptx
AshaS74
 
This material is Phython programming Course.
This material is Phython programming Course.
Asaminew Adugna
 
Python programming workshop session 3
Python programming workshop session 3
Abdul Haseeb
 
Python programming –part 3
Python programming –part 3
Megha V
 
Python for Beginners(v3)
Python for Beginners(v3)
Panimalar Engineering College
 
The document discusses for loops in Python. It explains that for loops are us...
The document discusses for loops in Python. It explains that for loops are us...
xuwnudbek266
 
python_avw - Unit-03.pdf
python_avw - Unit-03.pdf
AshaWankar1
 
Python Lists is a a evry jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...
Python Lists is a a evry jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...
KavineshKumarS
 
File handling in pythan.pptx
File handling in pythan.pptx
NawalKishore38
 
ADST university of Sussex foundation class
ADST university of Sussex foundation class
MarufFarhanRigan1
 
list and control statement.pptx
list and control statement.pptx
ssuser8f0410
 
Introduction To Programming with Python-4
Introduction To Programming with Python-4
Syed Farjad Zia Zaidi
 
Python Collection datatypes
Python Collection datatypes
Adheetha O. V
 
powerpoint 2-13.pptx
powerpoint 2-13.pptx
JuanPicasso7
 
PE1 Module 3.ppt
PE1 Module 3.ppt
balewayalew
 
Python programming
Python programming
sirikeshava
 
python_lab_manual_final (1).pdf
python_lab_manual_final (1).pdf
keerthu0442
 
ANSHUL RANA - PROGRAM FILE.pptx
ANSHUL RANA - PROGRAM FILE.pptx
jeyel85227
 
Python.pptx
Python.pptx
AshaS74
 
This material is Phython programming Course.
This material is Phython programming Course.
Asaminew Adugna
 
Python programming workshop session 3
Python programming workshop session 3
Abdul Haseeb
 
Python programming –part 3
Python programming –part 3
Megha V
 
The document discusses for loops in Python. It explains that for loops are us...
The document discusses for loops in Python. It explains that for loops are us...
xuwnudbek266
 
python_avw - Unit-03.pdf
python_avw - Unit-03.pdf
AshaWankar1
 
Python Lists is a a evry jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...
Python Lists is a a evry jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...
KavineshKumarS
 
File handling in pythan.pptx
File handling in pythan.pptx
NawalKishore38
 
ADST university of Sussex foundation class
ADST university of Sussex foundation class
MarufFarhanRigan1
 
Ad

Recently uploaded (20)

Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Impelsys Inc.
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
NTT DATA Technology & Innovation
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
June Patch Tuesday
June Patch Tuesday
Ivanti
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Impelsys Inc.
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
NTT DATA Technology & Innovation
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
June Patch Tuesday
June Patch Tuesday
Ivanti
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
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