SlideShare a Scribd company logo
1 of 1
Download to read offline
Use 'numList' file which got created above. Write a program that will prompt the user to enter
the name of the file lie. numlistl. and display the first 15 lines of the file's content. Use try/except
construct to capture any file opening related errors such as invalid file name ctc. Hints: Define
main 0 Declare variables: line and counter, and initialize them Prompt for fite name: use input
function Open the fle in read mode. Read the lines in the file with readine function:
'inputfile,readline0' and in 'tialize counter to 1 Use a while loop to read and display the first 15
lines Use istripi) method to remove ' in' characters at the end of the line Print the line Update the
counter when the line is read Close fite

More Related Content

More from amazingkidstoys

transcript. Which of the following are differences between DNA, which.pdf
 transcript. Which of the following are differences between DNA, which.pdf transcript. Which of the following are differences between DNA, which.pdf
transcript. Which of the following are differences between DNA, which.pdfamazingkidstoys
 
Trace the output of the following short program. If the program crash.pdf
 Trace the output of the following short program. If the program crash.pdf Trace the output of the following short program. If the program crash.pdf
Trace the output of the following short program. If the program crash.pdfamazingkidstoys
 
Treasury spot interest rates are as follows Part 1 Q. Attempt 110 f.pdf
 Treasury spot interest rates are as follows Part 1 Q. Attempt 110 f.pdf Treasury spot interest rates are as follows Part 1 Q. Attempt 110 f.pdf
Treasury spot interest rates are as follows Part 1 Q. Attempt 110 f.pdfamazingkidstoys
 
Total magnification of a microscope is determined by Multiple C.pdf
 Total magnification of a microscope is determined by Multiple C.pdf Total magnification of a microscope is determined by Multiple C.pdf
Total magnification of a microscope is determined by Multiple C.pdfamazingkidstoys
 
Topographic map of the Grand Duchy of Freedonia contour interval =20.pdf
 Topographic map of the Grand Duchy of Freedonia contour interval =20.pdf Topographic map of the Grand Duchy of Freedonia contour interval =20.pdf
Topographic map of the Grand Duchy of Freedonia contour interval =20.pdfamazingkidstoys
 
Tree inin A recursave tree data structure. Note the retationship bet.pdf
 Tree inin A recursave tree data structure. Note the retationship bet.pdf Tree inin A recursave tree data structure. Note the retationship bet.pdf
Tree inin A recursave tree data structure. Note the retationship bet.pdfamazingkidstoys
 
Use of Computer Services This case pertains to determining the approp.pdf
 Use of Computer Services This case pertains to determining the approp.pdf Use of Computer Services This case pertains to determining the approp.pdf
Use of Computer Services This case pertains to determining the approp.pdfamazingkidstoys
 
Travis Company purchased merchandise on account from a supplier for $.pdf
 Travis Company purchased merchandise on account from a supplier for $.pdf Travis Company purchased merchandise on account from a supplier for $.pdf
Travis Company purchased merchandise on account from a supplier for $.pdfamazingkidstoys
 
urrent Attempt in Progress At December 31, 2021, Martinez Imports rep.pdf
 urrent Attempt in Progress At December 31, 2021, Martinez Imports rep.pdf urrent Attempt in Progress At December 31, 2021, Martinez Imports rep.pdf
urrent Attempt in Progress At December 31, 2021, Martinez Imports rep.pdfamazingkidstoys
 
Use Figure 12.2 to answer the following questio.pdf
 Use Figure 12.2 to answer the following questio.pdf Use Figure 12.2 to answer the following questio.pdf
Use Figure 12.2 to answer the following questio.pdfamazingkidstoys
 
Use Excels Analysis ToolPak, with a seed of 1 , to generate 1,000 ra.pdf
 Use Excels Analysis ToolPak, with a seed of 1 , to generate 1,000 ra.pdf Use Excels Analysis ToolPak, with a seed of 1 , to generate 1,000 ra.pdf
Use Excels Analysis ToolPak, with a seed of 1 , to generate 1,000 ra.pdfamazingkidstoys
 
Under the heterogenous treatment effect setup and the usual LATE (Loc.pdf
 Under the heterogenous treatment effect setup and the usual LATE (Loc.pdf Under the heterogenous treatment effect setup and the usual LATE (Loc.pdf
Under the heterogenous treatment effect setup and the usual LATE (Loc.pdfamazingkidstoys
 
Understanding regional tectonics using beach balls Part I Remember b.pdf
 Understanding regional tectonics using beach balls Part I Remember b.pdf Understanding regional tectonics using beach balls Part I Remember b.pdf
Understanding regional tectonics using beach balls Part I Remember b.pdfamazingkidstoys
 
Use =0.05. What is your conclusion.pdf
 Use =0.05. What is your conclusion.pdf Use =0.05. What is your conclusion.pdf
Use =0.05. What is your conclusion.pdfamazingkidstoys
 
Understanding marginal and average tax rates Consider the imaginary n.pdf
 Understanding marginal and average tax rates Consider the imaginary n.pdf Understanding marginal and average tax rates Consider the imaginary n.pdf
Understanding marginal and average tax rates Consider the imaginary n.pdfamazingkidstoys
 
Tropical Cyclones - Know where tropical cyclones develop and the prim.pdf
 Tropical Cyclones - Know where tropical cyclones develop and the prim.pdf Tropical Cyclones - Know where tropical cyclones develop and the prim.pdf
Tropical Cyclones - Know where tropical cyclones develop and the prim.pdfamazingkidstoys
 
Unit 3.2 DB Irish Republic Army. Av Imagine that you lived in Irelan.pdf
 Unit 3.2 DB Irish Republic Army. Av Imagine that you lived in Irelan.pdf Unit 3.2 DB Irish Republic Army. Av Imagine that you lived in Irelan.pdf
Unit 3.2 DB Irish Republic Army. Av Imagine that you lived in Irelan.pdfamazingkidstoys
 
Una probabilidad es una afirmaci�n num�rica sobre la probabilidad.pdf
 Una probabilidad es una afirmaci�n num�rica sobre la probabilidad.pdf Una probabilidad es una afirmaci�n num�rica sobre la probabilidad.pdf
Una probabilidad es una afirmaci�n num�rica sobre la probabilidad.pdfamazingkidstoys
 
Una muestra de pulm�n de un paciente con neumon�a contiene bacilos .pdf
 Una muestra de pulm�n de un paciente con neumon�a contiene bacilos .pdf Una muestra de pulm�n de un paciente con neumon�a contiene bacilos .pdf
Una muestra de pulm�n de un paciente con neumon�a contiene bacilos .pdfamazingkidstoys
 
Una emisi�n de bonos de $500 000 en la que hay un descuentoprima n.pdf
 Una emisi�n de bonos de $500 000 en la que hay un descuentoprima n.pdf Una emisi�n de bonos de $500 000 en la que hay un descuentoprima n.pdf
Una emisi�n de bonos de $500 000 en la que hay un descuentoprima n.pdfamazingkidstoys
 

More from amazingkidstoys (20)

transcript. Which of the following are differences between DNA, which.pdf
 transcript. Which of the following are differences between DNA, which.pdf transcript. Which of the following are differences between DNA, which.pdf
transcript. Which of the following are differences between DNA, which.pdf
 
Trace the output of the following short program. If the program crash.pdf
 Trace the output of the following short program. If the program crash.pdf Trace the output of the following short program. If the program crash.pdf
Trace the output of the following short program. If the program crash.pdf
 
Treasury spot interest rates are as follows Part 1 Q. Attempt 110 f.pdf
 Treasury spot interest rates are as follows Part 1 Q. Attempt 110 f.pdf Treasury spot interest rates are as follows Part 1 Q. Attempt 110 f.pdf
Treasury spot interest rates are as follows Part 1 Q. Attempt 110 f.pdf
 
Total magnification of a microscope is determined by Multiple C.pdf
 Total magnification of a microscope is determined by Multiple C.pdf Total magnification of a microscope is determined by Multiple C.pdf
Total magnification of a microscope is determined by Multiple C.pdf
 
Topographic map of the Grand Duchy of Freedonia contour interval =20.pdf
 Topographic map of the Grand Duchy of Freedonia contour interval =20.pdf Topographic map of the Grand Duchy of Freedonia contour interval =20.pdf
Topographic map of the Grand Duchy of Freedonia contour interval =20.pdf
 
Tree inin A recursave tree data structure. Note the retationship bet.pdf
 Tree inin A recursave tree data structure. Note the retationship bet.pdf Tree inin A recursave tree data structure. Note the retationship bet.pdf
Tree inin A recursave tree data structure. Note the retationship bet.pdf
 
Use of Computer Services This case pertains to determining the approp.pdf
 Use of Computer Services This case pertains to determining the approp.pdf Use of Computer Services This case pertains to determining the approp.pdf
Use of Computer Services This case pertains to determining the approp.pdf
 
Travis Company purchased merchandise on account from a supplier for $.pdf
 Travis Company purchased merchandise on account from a supplier for $.pdf Travis Company purchased merchandise on account from a supplier for $.pdf
Travis Company purchased merchandise on account from a supplier for $.pdf
 
urrent Attempt in Progress At December 31, 2021, Martinez Imports rep.pdf
 urrent Attempt in Progress At December 31, 2021, Martinez Imports rep.pdf urrent Attempt in Progress At December 31, 2021, Martinez Imports rep.pdf
urrent Attempt in Progress At December 31, 2021, Martinez Imports rep.pdf
 
Use Figure 12.2 to answer the following questio.pdf
 Use Figure 12.2 to answer the following questio.pdf Use Figure 12.2 to answer the following questio.pdf
Use Figure 12.2 to answer the following questio.pdf
 
Use Excels Analysis ToolPak, with a seed of 1 , to generate 1,000 ra.pdf
 Use Excels Analysis ToolPak, with a seed of 1 , to generate 1,000 ra.pdf Use Excels Analysis ToolPak, with a seed of 1 , to generate 1,000 ra.pdf
Use Excels Analysis ToolPak, with a seed of 1 , to generate 1,000 ra.pdf
 
Under the heterogenous treatment effect setup and the usual LATE (Loc.pdf
 Under the heterogenous treatment effect setup and the usual LATE (Loc.pdf Under the heterogenous treatment effect setup and the usual LATE (Loc.pdf
Under the heterogenous treatment effect setup and the usual LATE (Loc.pdf
 
Understanding regional tectonics using beach balls Part I Remember b.pdf
 Understanding regional tectonics using beach balls Part I Remember b.pdf Understanding regional tectonics using beach balls Part I Remember b.pdf
Understanding regional tectonics using beach balls Part I Remember b.pdf
 
Use =0.05. What is your conclusion.pdf
 Use =0.05. What is your conclusion.pdf Use =0.05. What is your conclusion.pdf
Use =0.05. What is your conclusion.pdf
 
Understanding marginal and average tax rates Consider the imaginary n.pdf
 Understanding marginal and average tax rates Consider the imaginary n.pdf Understanding marginal and average tax rates Consider the imaginary n.pdf
Understanding marginal and average tax rates Consider the imaginary n.pdf
 
Tropical Cyclones - Know where tropical cyclones develop and the prim.pdf
 Tropical Cyclones - Know where tropical cyclones develop and the prim.pdf Tropical Cyclones - Know where tropical cyclones develop and the prim.pdf
Tropical Cyclones - Know where tropical cyclones develop and the prim.pdf
 
Unit 3.2 DB Irish Republic Army. Av Imagine that you lived in Irelan.pdf
 Unit 3.2 DB Irish Republic Army. Av Imagine that you lived in Irelan.pdf Unit 3.2 DB Irish Republic Army. Av Imagine that you lived in Irelan.pdf
Unit 3.2 DB Irish Republic Army. Av Imagine that you lived in Irelan.pdf
 
Una probabilidad es una afirmaci�n num�rica sobre la probabilidad.pdf
 Una probabilidad es una afirmaci�n num�rica sobre la probabilidad.pdf Una probabilidad es una afirmaci�n num�rica sobre la probabilidad.pdf
Una probabilidad es una afirmaci�n num�rica sobre la probabilidad.pdf
 
Una muestra de pulm�n de un paciente con neumon�a contiene bacilos .pdf
 Una muestra de pulm�n de un paciente con neumon�a contiene bacilos .pdf Una muestra de pulm�n de un paciente con neumon�a contiene bacilos .pdf
Una muestra de pulm�n de un paciente con neumon�a contiene bacilos .pdf
 
Una emisi�n de bonos de $500 000 en la que hay un descuentoprima n.pdf
 Una emisi�n de bonos de $500 000 en la que hay un descuentoprima n.pdf Una emisi�n de bonos de $500 000 en la que hay un descuentoprima n.pdf
Una emisi�n de bonos de $500 000 en la que hay un descuentoprima n.pdf
 

Recently uploaded

Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 

Recently uploaded (20)

Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 

Use numList file which got created above. Write a program that will.pdf

  • 1. Use 'numList' file which got created above. Write a program that will prompt the user to enter the name of the file lie. numlistl. and display the first 15 lines of the file's content. Use try/except construct to capture any file opening related errors such as invalid file name ctc. Hints: Define main 0 Declare variables: line and counter, and initialize them Prompt for fite name: use input function Open the fle in read mode. Read the lines in the file with readine function: 'inputfile,readline0' and in 'tialize counter to 1 Use a while loop to read and display the first 15 lines Use istripi) method to remove ' in' characters at the end of the line Print the line Update the counter when the line is read Close fite