SlideShare a Scribd company logo
1 of 1
1.
Longest Words
Write a Python program that reads words from a file (file name
user supplied) in which the words are stored one per line. Your
program will print to screen the ten longest words and gives
their file location in the original file, assuming the first word is
stored in location #1.
2.
File Reading
Write a Python program to read first n lines of a file. User will
supply name of file.

More Related Content

More from gasciognecaren

1.Rebecca SperryMar 29, 2020Mar 29 at 552pmManage Discussion .docx
1.Rebecca SperryMar 29, 2020Mar 29 at 552pmManage Discussion .docx1.Rebecca SperryMar 29, 2020Mar 29 at 552pmManage Discussion .docx
1.Rebecca SperryMar 29, 2020Mar 29 at 552pmManage Discussion .docxgasciognecaren
 
1.Probability ConceptsDuring an epidemic of disease, a doctor se.docx
1.Probability ConceptsDuring an epidemic of disease, a doctor se.docx1.Probability ConceptsDuring an epidemic of disease, a doctor se.docx
1.Probability ConceptsDuring an epidemic of disease, a doctor se.docxgasciognecaren
 
1.Find a test to assess, intelligence or education, find a similar a.docx
1.Find a test to assess, intelligence or education, find a similar a.docx1.Find a test to assess, intelligence or education, find a similar a.docx
1.Find a test to assess, intelligence or education, find a similar a.docxgasciognecaren
 
1.Over the past few years, we have seen both emerging and reemerging.docx
1.Over the past few years, we have seen both emerging and reemerging.docx1.Over the past few years, we have seen both emerging and reemerging.docx
1.Over the past few years, we have seen both emerging and reemerging.docxgasciognecaren
 
1.Ornette Coleman Lonely Womanhttpswww.youtube.comwatchv=D.docx
1.Ornette Coleman Lonely Womanhttpswww.youtube.comwatchv=D.docx1.Ornette Coleman Lonely Womanhttpswww.youtube.comwatchv=D.docx
1.Ornette Coleman Lonely Womanhttpswww.youtube.comwatchv=D.docxgasciognecaren
 
1.In patients with acute respiratory distress syndrome (P), .docx
1.In patients with acute respiratory distress syndrome (P), .docx1.In patients with acute respiratory distress syndrome (P), .docx
1.In patients with acute respiratory distress syndrome (P), .docxgasciognecaren
 
1.How is culture reflected in television and movies What relations.docx
1.How is culture reflected in television and movies What relations.docx1.How is culture reflected in television and movies What relations.docx
1.How is culture reflected in television and movies What relations.docxgasciognecaren
 
1.How are the firm’s operational and key risk factors captured in th.docx
1.How are the firm’s operational and key risk factors captured in th.docx1.How are the firm’s operational and key risk factors captured in th.docx
1.How are the firm’s operational and key risk factors captured in th.docxgasciognecaren
 
1.How do you define modernist literature and how does it relate to o.docx
1.How do you define modernist literature and how does it relate to o.docx1.How do you define modernist literature and how does it relate to o.docx
1.How do you define modernist literature and how does it relate to o.docxgasciognecaren
 
1.GOAL STATEMENT Please complete the following goal statement.docx
1.GOAL STATEMENT Please complete the following goal statement.docx1.GOAL STATEMENT Please complete the following goal statement.docx
1.GOAL STATEMENT Please complete the following goal statement.docxgasciognecaren
 
1.Functional Analysis Interview (FAI) is a type of structured in.docx
1.Functional Analysis Interview (FAI) is a type of structured in.docx1.Functional Analysis Interview (FAI) is a type of structured in.docx
1.Functional Analysis Interview (FAI) is a type of structured in.docxgasciognecaren
 
1.Explain why the following communication is not a valid offer.docx
1.Explain why the following communication is not a valid offer.docx1.Explain why the following communication is not a valid offer.docx
1.Explain why the following communication is not a valid offer.docxgasciognecaren
 
1.First, what is the Older Americans Act (OAA) What is the s.docx
1.First, what is the Older Americans Act (OAA) What is the s.docx1.First, what is the Older Americans Act (OAA) What is the s.docx
1.First, what is the Older Americans Act (OAA) What is the s.docxgasciognecaren
 
1.Explain the pathophysiologic processes of select healt.docx
1.Explain the pathophysiologic processes of select healt.docx1.Explain the pathophysiologic processes of select healt.docx
1.Explain the pathophysiologic processes of select healt.docxgasciognecaren
 
1.Explain why caregivers are considered patient advocates.     o.docx
1.Explain why caregivers are considered patient advocates.     o.docx1.Explain why caregivers are considered patient advocates.     o.docx
1.Explain why caregivers are considered patient advocates.     o.docxgasciognecaren
 
1.Explain the diagnostic criteria for a mood disorder of your ch.docx
1.Explain the diagnostic criteria for a mood disorder of your ch.docx1.Explain the diagnostic criteria for a mood disorder of your ch.docx
1.Explain the diagnostic criteria for a mood disorder of your ch.docxgasciognecaren
 
1.Class, what do you think might be some long term changes that happ.docx
1.Class, what do you think might be some long term changes that happ.docx1.Class, what do you think might be some long term changes that happ.docx
1.Class, what do you think might be some long term changes that happ.docxgasciognecaren
 
1.Describe the difference between a vision statement and a missi.docx
1.Describe the difference between a vision statement and a missi.docx1.Describe the difference between a vision statement and a missi.docx
1.Describe the difference between a vision statement and a missi.docxgasciognecaren
 
1.Briefly explain the role that faith played in U.S.      foreig.docx
1.Briefly explain the role that faith played in U.S.      foreig.docx1.Briefly explain the role that faith played in U.S.      foreig.docx
1.Briefly explain the role that faith played in U.S.      foreig.docxgasciognecaren
 
1.Discussion Conduct research and summarize why do you beli.docx
1.Discussion Conduct research and summarize why do you beli.docx1.Discussion Conduct research and summarize why do you beli.docx
1.Discussion Conduct research and summarize why do you beli.docxgasciognecaren
 

More from gasciognecaren (20)

1.Rebecca SperryMar 29, 2020Mar 29 at 552pmManage Discussion .docx
1.Rebecca SperryMar 29, 2020Mar 29 at 552pmManage Discussion .docx1.Rebecca SperryMar 29, 2020Mar 29 at 552pmManage Discussion .docx
1.Rebecca SperryMar 29, 2020Mar 29 at 552pmManage Discussion .docx
 
1.Probability ConceptsDuring an epidemic of disease, a doctor se.docx
1.Probability ConceptsDuring an epidemic of disease, a doctor se.docx1.Probability ConceptsDuring an epidemic of disease, a doctor se.docx
1.Probability ConceptsDuring an epidemic of disease, a doctor se.docx
 
1.Find a test to assess, intelligence or education, find a similar a.docx
1.Find a test to assess, intelligence or education, find a similar a.docx1.Find a test to assess, intelligence or education, find a similar a.docx
1.Find a test to assess, intelligence or education, find a similar a.docx
 
1.Over the past few years, we have seen both emerging and reemerging.docx
1.Over the past few years, we have seen both emerging and reemerging.docx1.Over the past few years, we have seen both emerging and reemerging.docx
1.Over the past few years, we have seen both emerging and reemerging.docx
 
1.Ornette Coleman Lonely Womanhttpswww.youtube.comwatchv=D.docx
1.Ornette Coleman Lonely Womanhttpswww.youtube.comwatchv=D.docx1.Ornette Coleman Lonely Womanhttpswww.youtube.comwatchv=D.docx
1.Ornette Coleman Lonely Womanhttpswww.youtube.comwatchv=D.docx
 
1.In patients with acute respiratory distress syndrome (P), .docx
1.In patients with acute respiratory distress syndrome (P), .docx1.In patients with acute respiratory distress syndrome (P), .docx
1.In patients with acute respiratory distress syndrome (P), .docx
 
1.How is culture reflected in television and movies What relations.docx
1.How is culture reflected in television and movies What relations.docx1.How is culture reflected in television and movies What relations.docx
1.How is culture reflected in television and movies What relations.docx
 
1.How are the firm’s operational and key risk factors captured in th.docx
1.How are the firm’s operational and key risk factors captured in th.docx1.How are the firm’s operational and key risk factors captured in th.docx
1.How are the firm’s operational and key risk factors captured in th.docx
 
1.How do you define modernist literature and how does it relate to o.docx
1.How do you define modernist literature and how does it relate to o.docx1.How do you define modernist literature and how does it relate to o.docx
1.How do you define modernist literature and how does it relate to o.docx
 
1.GOAL STATEMENT Please complete the following goal statement.docx
1.GOAL STATEMENT Please complete the following goal statement.docx1.GOAL STATEMENT Please complete the following goal statement.docx
1.GOAL STATEMENT Please complete the following goal statement.docx
 
1.Functional Analysis Interview (FAI) is a type of structured in.docx
1.Functional Analysis Interview (FAI) is a type of structured in.docx1.Functional Analysis Interview (FAI) is a type of structured in.docx
1.Functional Analysis Interview (FAI) is a type of structured in.docx
 
1.Explain why the following communication is not a valid offer.docx
1.Explain why the following communication is not a valid offer.docx1.Explain why the following communication is not a valid offer.docx
1.Explain why the following communication is not a valid offer.docx
 
1.First, what is the Older Americans Act (OAA) What is the s.docx
1.First, what is the Older Americans Act (OAA) What is the s.docx1.First, what is the Older Americans Act (OAA) What is the s.docx
1.First, what is the Older Americans Act (OAA) What is the s.docx
 
1.Explain the pathophysiologic processes of select healt.docx
1.Explain the pathophysiologic processes of select healt.docx1.Explain the pathophysiologic processes of select healt.docx
1.Explain the pathophysiologic processes of select healt.docx
 
1.Explain why caregivers are considered patient advocates.     o.docx
1.Explain why caregivers are considered patient advocates.     o.docx1.Explain why caregivers are considered patient advocates.     o.docx
1.Explain why caregivers are considered patient advocates.     o.docx
 
1.Explain the diagnostic criteria for a mood disorder of your ch.docx
1.Explain the diagnostic criteria for a mood disorder of your ch.docx1.Explain the diagnostic criteria for a mood disorder of your ch.docx
1.Explain the diagnostic criteria for a mood disorder of your ch.docx
 
1.Class, what do you think might be some long term changes that happ.docx
1.Class, what do you think might be some long term changes that happ.docx1.Class, what do you think might be some long term changes that happ.docx
1.Class, what do you think might be some long term changes that happ.docx
 
1.Describe the difference between a vision statement and a missi.docx
1.Describe the difference between a vision statement and a missi.docx1.Describe the difference between a vision statement and a missi.docx
1.Describe the difference between a vision statement and a missi.docx
 
1.Briefly explain the role that faith played in U.S.      foreig.docx
1.Briefly explain the role that faith played in U.S.      foreig.docx1.Briefly explain the role that faith played in U.S.      foreig.docx
1.Briefly explain the role that faith played in U.S.      foreig.docx
 
1.Discussion Conduct research and summarize why do you beli.docx
1.Discussion Conduct research and summarize why do you beli.docx1.Discussion Conduct research and summarize why do you beli.docx
1.Discussion Conduct research and summarize why do you beli.docx
 

Recently uploaded

Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptxVishal Singh
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...EduSkills OECD
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project researchCaitlinCummins3
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxAdelaideRefugio
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesAmanpreetKaur157993
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...Nguyen Thanh Tu Collection
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportDenish Jangid
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfContoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfcupulin
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 

Recently uploaded (20)

Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfContoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 

1.Longest WordsWrite a Python program that reads wor.docx

  • 1. 1. Longest Words Write a Python program that reads words from a file (file name user supplied) in which the words are stored one per line. Your program will print to screen the ten longest words and gives their file location in the original file, assuming the first word is stored in location #1. 2. File Reading Write a Python program to read first n lines of a file. User will supply name of file.