SlideShare a Scribd company logo
1) Write a python code that initializes a list called Numbers with zero elements. 2) Write a while
loop that uses the append list method to update this list so that it has the natural numbers 1,2,3,,
10 as its elements. Print out the list Number using the print statement. 3) Next initialize a list called
Evens with zero elements. This is intended to be a list of boolean elements such that if k is an
index Evens [k]= True if Numbers [k]= even Evens [k]= False if Numbers [k]= odd 3) Using the if-
else construct along with a while loop generate and update the list Evens. Print out the list Evens
4) Extra credit (5 points). Can you use list comprehension to generate the Evens list instead of an
if-else embedded inside a while loop. See how elegant Python can be where a snippet of code
many lines long can be condensed to one line if the correct commands are known to you!

More Related Content

Similar to 1 Write a python code that initializes a list called Number.pdf

CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docx
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docxCS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docx
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docx
faithxdunce63732
 
arrays-120712074248-phpapp01
arrays-120712074248-phpapp01arrays-120712074248-phpapp01
arrays-120712074248-phpapp01Abdul Samee
 
Introduction To Programming with Python-3
Introduction To Programming with Python-3Introduction To Programming with Python-3
Introduction To Programming with Python-3
Syed Farjad Zia Zaidi
 
Sequences: Strings, Lists, and Files
Sequences: Strings, Lists, and FilesSequences: Strings, Lists, and Files
Sequences: Strings, Lists, and Files
Edwin Flórez Gómez
 
Looping in PythonLab8 lecture slides.pptx
Looping in PythonLab8 lecture slides.pptxLooping in PythonLab8 lecture slides.pptx
Looping in PythonLab8 lecture slides.pptx
adihartanto7
 
11 Unit 1 Chapter 03 Data Handling
11   Unit 1 Chapter 03 Data Handling11   Unit 1 Chapter 03 Data Handling
11 Unit 1 Chapter 03 Data Handling
Praveen M Jigajinni
 
Chapter 10 data handling
Chapter 10 data handlingChapter 10 data handling
Chapter 10 data handling
Praveen M Jigajinni
 
Tuples-and-Dictionaries.pptx
Tuples-and-Dictionaries.pptxTuples-and-Dictionaries.pptx
Tuples-and-Dictionaries.pptx
AyushTripathi998357
 
Python For Data Science.pptx
Python For Data Science.pptxPython For Data Science.pptx
Python For Data Science.pptx
rohithprabhas1
 
1. python programming
1. python programming1. python programming
1. python programming
sreeLekha51
 
python
pythonpython
python
ultragamer6
 
Python workshop
Python workshopPython workshop
Python workshop
Jibin Sabu
 
ETinCT.pptx
ETinCT.pptxETinCT.pptx
AI_2nd Lab.pptx
AI_2nd Lab.pptxAI_2nd Lab.pptx
AI_2nd Lab.pptx
MohammedAlYemeni1
 
Parts of python programming language
Parts of python programming languageParts of python programming language
Parts of python programming language
Megha V
 
Engineering CS 5th Sem Python Module -2.pptx
Engineering CS 5th Sem Python Module -2.pptxEngineering CS 5th Sem Python Module -2.pptx
Engineering CS 5th Sem Python Module -2.pptx
hardii0991
 

Similar to 1 Write a python code that initializes a list called Number.pdf (20)

Python lists
Python listsPython lists
Python lists
 
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docx
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docxCS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docx
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docx
 
arrays-120712074248-phpapp01
arrays-120712074248-phpapp01arrays-120712074248-phpapp01
arrays-120712074248-phpapp01
 
Introduction To Programming with Python-3
Introduction To Programming with Python-3Introduction To Programming with Python-3
Introduction To Programming with Python-3
 
Sequences: Strings, Lists, and Files
Sequences: Strings, Lists, and FilesSequences: Strings, Lists, and Files
Sequences: Strings, Lists, and Files
 
Looping in PythonLab8 lecture slides.pptx
Looping in PythonLab8 lecture slides.pptxLooping in PythonLab8 lecture slides.pptx
Looping in PythonLab8 lecture slides.pptx
 
11 Unit 1 Chapter 03 Data Handling
11   Unit 1 Chapter 03 Data Handling11   Unit 1 Chapter 03 Data Handling
11 Unit 1 Chapter 03 Data Handling
 
Chapter 10 data handling
Chapter 10 data handlingChapter 10 data handling
Chapter 10 data handling
 
Tuples-and-Dictionaries.pptx
Tuples-and-Dictionaries.pptxTuples-and-Dictionaries.pptx
Tuples-and-Dictionaries.pptx
 
Python For Data Science.pptx
Python For Data Science.pptxPython For Data Science.pptx
Python For Data Science.pptx
 
1. python programming
1. python programming1. python programming
1. python programming
 
Python slide.1
Python slide.1Python slide.1
Python slide.1
 
python
pythonpython
python
 
Python workshop
Python workshopPython workshop
Python workshop
 
ETinCT.pptx
ETinCT.pptxETinCT.pptx
ETinCT.pptx
 
AI_2nd Lab.pptx
AI_2nd Lab.pptxAI_2nd Lab.pptx
AI_2nd Lab.pptx
 
Python Tutorial Part 1
Python Tutorial Part 1Python Tutorial Part 1
Python Tutorial Part 1
 
Parts of python programming language
Parts of python programming languageParts of python programming language
Parts of python programming language
 
Chapter05
Chapter05Chapter05
Chapter05
 
Engineering CS 5th Sem Python Module -2.pptx
Engineering CS 5th Sem Python Module -2.pptxEngineering CS 5th Sem Python Module -2.pptx
Engineering CS 5th Sem Python Module -2.pptx
 

More from abhishek483040

1 Ykc bir yeniliki olan bir firma rnei verin Teknoloji .pdf
1 Ykc bir yeniliki olan bir firma rnei verin Teknoloji .pdf1 Ykc bir yeniliki olan bir firma rnei verin Teknoloji .pdf
1 Ykc bir yeniliki olan bir firma rnei verin Teknoloji .pdf
abhishek483040
 
1 Yeni bir kltrel deneyim yaratmak iin yerli ve yabanc.pdf
1 Yeni bir kltrel deneyim yaratmak iin yerli ve yabanc.pdf1 Yeni bir kltrel deneyim yaratmak iin yerli ve yabanc.pdf
1 Yeni bir kltrel deneyim yaratmak iin yerli ve yabanc.pdf
abhishek483040
 
1 Yava iddet kavramn Shannon OLearn Climate science and.pdf
1 Yava iddet kavramn Shannon OLearn Climate science and.pdf1 Yava iddet kavramn Shannon OLearn Climate science and.pdf
1 Yava iddet kavramn Shannon OLearn Climate science and.pdf
abhishek483040
 
1 Write briefly about the difference between feature select.pdf
1 Write briefly about the difference between feature select.pdf1 Write briefly about the difference between feature select.pdf
1 Write briefly about the difference between feature select.pdf
abhishek483040
 
1 Write the hypothesis being addressed by the data displaye.pdf
1 Write the hypothesis being addressed by the data displaye.pdf1 Write the hypothesis being addressed by the data displaye.pdf
1 Write the hypothesis being addressed by the data displaye.pdf
abhishek483040
 
1 wwwsecgov web sitesine gidin ve General Electric GE d.pdf
1 wwwsecgov web sitesine gidin ve General Electric GE d.pdf1 wwwsecgov web sitesine gidin ve General Electric GE d.pdf
1 wwwsecgov web sitesine gidin ve General Electric GE d.pdf
abhishek483040
 
1 Why is cell division important for both single cellular a.pdf
1 Why is cell division important for both single cellular a.pdf1 Why is cell division important for both single cellular a.pdf
1 Why is cell division important for both single cellular a.pdf
abhishek483040
 
1 Write a program that creates an Integer class Date which .pdf
1 Write a program that creates an Integer class Date which .pdf1 Write a program that creates an Integer class Date which .pdf
1 Write a program that creates an Integer class Date which .pdf
abhishek483040
 
1 Write a function named time that has an integer parame.pdf
1 Write a function named time  that has an integer parame.pdf1 Write a function named time  that has an integer parame.pdf
1 Write a function named time that has an integer parame.pdf
abhishek483040
 
1 Write a paper on the topic The impact of the implementat.pdf
1 Write a paper on the topic The impact of the implementat.pdf1 Write a paper on the topic The impact of the implementat.pdf
1 Write a paper on the topic The impact of the implementat.pdf
abhishek483040
 
1 Write a function to add the integers from a to b a and b.pdf
1 Write a function to add the integers from a to b a and b.pdf1 Write a function to add the integers from a to b a and b.pdf
1 Write a function to add the integers from a to b a and b.pdf
abhishek483040
 
1 Write a detailed comprehensive brand strategy report for .pdf
1 Write a detailed comprehensive brand strategy report for .pdf1 Write a detailed comprehensive brand strategy report for .pdf
1 Write a detailed comprehensive brand strategy report for .pdf
abhishek483040
 
1 Within this assignment you must detail specific material .pdf
1 Within this assignment you must detail specific material .pdf1 Within this assignment you must detail specific material .pdf
1 Within this assignment you must detail specific material .pdf
abhishek483040
 
1 Why would you want to make your work reproducible 2 W.pdf
1 Why would you want to make your work reproducible 2 W.pdf1 Why would you want to make your work reproducible 2 W.pdf
1 Why would you want to make your work reproducible 2 W.pdf
abhishek483040
 
1 Which of the following statements is not TRUE regarding S.pdf
1 Which of the following statements is not TRUE regarding S.pdf1 Which of the following statements is not TRUE regarding S.pdf
1 Which of the following statements is not TRUE regarding S.pdf
abhishek483040
 
1 Winterville a city of population 125000 in the Rust Bel.pdf
1 Winterville a city of population 125000 in the Rust Bel.pdf1 Winterville a city of population 125000 in the Rust Bel.pdf
1 Winterville a city of population 125000 in the Rust Bel.pdf
abhishek483040
 
1 Why is transportation considered so important to the US.pdf
1 Why is transportation considered so important to the US.pdf1 Why is transportation considered so important to the US.pdf
1 Why is transportation considered so important to the US.pdf
abhishek483040
 
1 Why do cells need their DNA to be condensed before dividi.pdf
1 Why do cells need their DNA to be condensed before dividi.pdf1 Why do cells need their DNA to be condensed before dividi.pdf
1 Why do cells need their DNA to be condensed before dividi.pdf
abhishek483040
 
1 Which wariable is the dependent wariable Choose a Amou.pdf
1 Which wariable is the dependent wariable Choose a Amou.pdf1 Which wariable is the dependent wariable Choose a Amou.pdf
1 Which wariable is the dependent wariable Choose a Amou.pdf
abhishek483040
 
1 Why do you think that there are two different types of DN.pdf
1 Why do you think that there are two different types of DN.pdf1 Why do you think that there are two different types of DN.pdf
1 Why do you think that there are two different types of DN.pdf
abhishek483040
 

More from abhishek483040 (20)

1 Ykc bir yeniliki olan bir firma rnei verin Teknoloji .pdf
1 Ykc bir yeniliki olan bir firma rnei verin Teknoloji .pdf1 Ykc bir yeniliki olan bir firma rnei verin Teknoloji .pdf
1 Ykc bir yeniliki olan bir firma rnei verin Teknoloji .pdf
 
1 Yeni bir kltrel deneyim yaratmak iin yerli ve yabanc.pdf
1 Yeni bir kltrel deneyim yaratmak iin yerli ve yabanc.pdf1 Yeni bir kltrel deneyim yaratmak iin yerli ve yabanc.pdf
1 Yeni bir kltrel deneyim yaratmak iin yerli ve yabanc.pdf
 
1 Yava iddet kavramn Shannon OLearn Climate science and.pdf
1 Yava iddet kavramn Shannon OLearn Climate science and.pdf1 Yava iddet kavramn Shannon OLearn Climate science and.pdf
1 Yava iddet kavramn Shannon OLearn Climate science and.pdf
 
1 Write briefly about the difference between feature select.pdf
1 Write briefly about the difference between feature select.pdf1 Write briefly about the difference between feature select.pdf
1 Write briefly about the difference between feature select.pdf
 
1 Write the hypothesis being addressed by the data displaye.pdf
1 Write the hypothesis being addressed by the data displaye.pdf1 Write the hypothesis being addressed by the data displaye.pdf
1 Write the hypothesis being addressed by the data displaye.pdf
 
1 wwwsecgov web sitesine gidin ve General Electric GE d.pdf
1 wwwsecgov web sitesine gidin ve General Electric GE d.pdf1 wwwsecgov web sitesine gidin ve General Electric GE d.pdf
1 wwwsecgov web sitesine gidin ve General Electric GE d.pdf
 
1 Why is cell division important for both single cellular a.pdf
1 Why is cell division important for both single cellular a.pdf1 Why is cell division important for both single cellular a.pdf
1 Why is cell division important for both single cellular a.pdf
 
1 Write a program that creates an Integer class Date which .pdf
1 Write a program that creates an Integer class Date which .pdf1 Write a program that creates an Integer class Date which .pdf
1 Write a program that creates an Integer class Date which .pdf
 
1 Write a function named time that has an integer parame.pdf
1 Write a function named time  that has an integer parame.pdf1 Write a function named time  that has an integer parame.pdf
1 Write a function named time that has an integer parame.pdf
 
1 Write a paper on the topic The impact of the implementat.pdf
1 Write a paper on the topic The impact of the implementat.pdf1 Write a paper on the topic The impact of the implementat.pdf
1 Write a paper on the topic The impact of the implementat.pdf
 
1 Write a function to add the integers from a to b a and b.pdf
1 Write a function to add the integers from a to b a and b.pdf1 Write a function to add the integers from a to b a and b.pdf
1 Write a function to add the integers from a to b a and b.pdf
 
1 Write a detailed comprehensive brand strategy report for .pdf
1 Write a detailed comprehensive brand strategy report for .pdf1 Write a detailed comprehensive brand strategy report for .pdf
1 Write a detailed comprehensive brand strategy report for .pdf
 
1 Within this assignment you must detail specific material .pdf
1 Within this assignment you must detail specific material .pdf1 Within this assignment you must detail specific material .pdf
1 Within this assignment you must detail specific material .pdf
 
1 Why would you want to make your work reproducible 2 W.pdf
1 Why would you want to make your work reproducible 2 W.pdf1 Why would you want to make your work reproducible 2 W.pdf
1 Why would you want to make your work reproducible 2 W.pdf
 
1 Which of the following statements is not TRUE regarding S.pdf
1 Which of the following statements is not TRUE regarding S.pdf1 Which of the following statements is not TRUE regarding S.pdf
1 Which of the following statements is not TRUE regarding S.pdf
 
1 Winterville a city of population 125000 in the Rust Bel.pdf
1 Winterville a city of population 125000 in the Rust Bel.pdf1 Winterville a city of population 125000 in the Rust Bel.pdf
1 Winterville a city of population 125000 in the Rust Bel.pdf
 
1 Why is transportation considered so important to the US.pdf
1 Why is transportation considered so important to the US.pdf1 Why is transportation considered so important to the US.pdf
1 Why is transportation considered so important to the US.pdf
 
1 Why do cells need their DNA to be condensed before dividi.pdf
1 Why do cells need their DNA to be condensed before dividi.pdf1 Why do cells need their DNA to be condensed before dividi.pdf
1 Why do cells need their DNA to be condensed before dividi.pdf
 
1 Which wariable is the dependent wariable Choose a Amou.pdf
1 Which wariable is the dependent wariable Choose a Amou.pdf1 Which wariable is the dependent wariable Choose a Amou.pdf
1 Which wariable is the dependent wariable Choose a Amou.pdf
 
1 Why do you think that there are two different types of DN.pdf
1 Why do you think that there are two different types of DN.pdf1 Why do you think that there are two different types of DN.pdf
1 Why do you think that there are two different types of DN.pdf
 

Recently uploaded

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 

Recently uploaded (20)

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 

1 Write a python code that initializes a list called Number.pdf

  • 1. 1) Write a python code that initializes a list called Numbers with zero elements. 2) Write a while loop that uses the append list method to update this list so that it has the natural numbers 1,2,3,, 10 as its elements. Print out the list Number using the print statement. 3) Next initialize a list called Evens with zero elements. This is intended to be a list of boolean elements such that if k is an index Evens [k]= True if Numbers [k]= even Evens [k]= False if Numbers [k]= odd 3) Using the if- else construct along with a while loop generate and update the list Evens. Print out the list Evens 4) Extra credit (5 points). Can you use list comprehension to generate the Evens list instead of an if-else embedded inside a while loop. See how elegant Python can be where a snippet of code many lines long can be condensed to one line if the correct commands are known to you!