SlideShare a Scribd company logo
1 of 1
What will be the result of the following program if there is only one file called myfile.txt in the
current directory? try: myfile = open( "myfile.txt") myfile.write( ""*") except: myfile =
open("mynewf i le.txt", "w") myfile.write("1") myfile.txt will be opened and 0 will be written in
it myfile.txt will be created and 1 will be written in it mynewfile.txt be will opened and 0 will be
written in it mynewfile,txt will be created and 1 will be written in it Which error do you expect to
encounter when you run the following code? [ begin{array}{l} text { my_sting = "Hello
World" }  text { print(mystring(14]) } end{array} ] NameEirror: TypeError IndexError

More Related Content

More from mckerliejonelle

WHAT IS YOUR CULTURAL INTELLIGENCE- Instructlons- To what extent does.docx
WHAT IS YOUR CULTURAL INTELLIGENCE- Instructlons- To what extent does.docxWHAT IS YOUR CULTURAL INTELLIGENCE- Instructlons- To what extent does.docx
WHAT IS YOUR CULTURAL INTELLIGENCE- Instructlons- To what extent does.docxmckerliejonelle
 
What is true about the relative concentration of H+ and OH- in water-.docx
What is true about the relative concentration of H+ and OH- in water-.docxWhat is true about the relative concentration of H+ and OH- in water-.docx
What is true about the relative concentration of H+ and OH- in water-.docxmckerliejonelle
 
What is the result (in binary) of adding the unsigned char binary numb.docx
What is the result (in binary) of adding the unsigned char binary numb.docxWhat is the result (in binary) of adding the unsigned char binary numb.docx
What is the result (in binary) of adding the unsigned char binary numb.docxmckerliejonelle
 
What is the resolution of a digital-to-analog converter (DAC)- It is t.docx
What is the resolution of a digital-to-analog converter (DAC)- It is t.docxWhat is the resolution of a digital-to-analog converter (DAC)- It is t.docx
What is the resolution of a digital-to-analog converter (DAC)- It is t.docxmckerliejonelle
 
What is the primary reason that Earth is cold at the poles and hot at.docx
What is the primary reason that Earth is cold at the poles and hot at.docxWhat is the primary reason that Earth is cold at the poles and hot at.docx
What is the primary reason that Earth is cold at the poles and hot at.docxmckerliejonelle
 
What is the main differentiating factor of an Advanced Alternative Pay.docx
What is the main differentiating factor of an Advanced Alternative Pay.docxWhat is the main differentiating factor of an Advanced Alternative Pay.docx
What is the main differentiating factor of an Advanced Alternative Pay.docxmckerliejonelle
 
What is the main difterence between Al- ML- and OL- Select ones a- ML.docx
What is the main difterence between Al- ML- and OL- Select ones a- ML.docxWhat is the main difterence between Al- ML- and OL- Select ones a- ML.docx
What is the main difterence between Al- ML- and OL- Select ones a- ML.docxmckerliejonelle
 
What is the function of helper T cells in cell mediated immunity- Kill.docx
What is the function of helper T cells in cell mediated immunity- Kill.docxWhat is the function of helper T cells in cell mediated immunity- Kill.docx
What is the function of helper T cells in cell mediated immunity- Kill.docxmckerliejonelle
 
What is the general FUNCTION of this tissue tvoe- -Pseberbunef that pe.docx
What is the general FUNCTION of this tissue tvoe- -Pseberbunef that pe.docxWhat is the general FUNCTION of this tissue tvoe- -Pseberbunef that pe.docx
What is the general FUNCTION of this tissue tvoe- -Pseberbunef that pe.docxmckerliejonelle
 
What is the effect of cholesterol on membrane fluidity at physiologic.docx
What is the effect of cholesterol on membrane fluidity at physiologic.docxWhat is the effect of cholesterol on membrane fluidity at physiologic.docx
What is the effect of cholesterol on membrane fluidity at physiologic.docxmckerliejonelle
 
What is the default IP Prefix for a Class A- -16 124 130 18.docx
What is the default IP Prefix for a Class A- -16 124 130 18.docxWhat is the default IP Prefix for a Class A- -16 124 130 18.docx
What is the default IP Prefix for a Class A- -16 124 130 18.docxmckerliejonelle
 
What is the biggest animal in the world- What is the only active volca.docx
What is the biggest animal in the world- What is the only active volca.docxWhat is the biggest animal in the world- What is the only active volca.docx
What is the biggest animal in the world- What is the only active volca.docxmckerliejonelle
 
What is performance- What factors affect performance- What are the dim.docx
What is performance- What factors affect performance- What are the dim.docxWhat is performance- What factors affect performance- What are the dim.docx
What is performance- What factors affect performance- What are the dim.docxmckerliejonelle
 
What is NOT true about protein migration during polyacrylamide gel ele.docx
What is NOT true about protein migration during polyacrylamide gel ele.docxWhat is NOT true about protein migration during polyacrylamide gel ele.docx
What is NOT true about protein migration during polyacrylamide gel ele.docxmckerliejonelle
 
What is NOT true about primary protein structures- A- the core of the.docx
What is NOT true about primary protein structures- A- the core of the.docxWhat is NOT true about primary protein structures- A- the core of the.docx
What is NOT true about primary protein structures- A- the core of the.docxmckerliejonelle
 
What is NOT a mechanism of viral interaction between a receptor and th.docx
What is NOT a mechanism of viral interaction between a receptor and th.docxWhat is NOT a mechanism of viral interaction between a receptor and th.docx
What is NOT a mechanism of viral interaction between a receptor and th.docxmckerliejonelle
 
What is its quartile range of the data- What is the lower bound- What.docx
What is its quartile range of the data- What is the lower bound- What.docxWhat is its quartile range of the data- What is the lower bound- What.docx
What is its quartile range of the data- What is the lower bound- What.docxmckerliejonelle
 
What is an action potential- what is its physiological significance-.docx
What is an action potential- what is its physiological significance-.docxWhat is an action potential- what is its physiological significance-.docx
What is an action potential- what is its physiological significance-.docxmckerliejonelle
 
What is a -mutant- and how is a mutant created- (Please include the SO.docx
What is a -mutant- and how is a mutant created- (Please include the SO.docxWhat is a -mutant- and how is a mutant created- (Please include the SO.docx
What is a -mutant- and how is a mutant created- (Please include the SO.docxmckerliejonelle
 
What information does UEFI-BIOS report about total memory installed an.docx
What information does UEFI-BIOS report about total memory installed an.docxWhat information does UEFI-BIOS report about total memory installed an.docx
What information does UEFI-BIOS report about total memory installed an.docxmckerliejonelle
 

More from mckerliejonelle (20)

WHAT IS YOUR CULTURAL INTELLIGENCE- Instructlons- To what extent does.docx
WHAT IS YOUR CULTURAL INTELLIGENCE- Instructlons- To what extent does.docxWHAT IS YOUR CULTURAL INTELLIGENCE- Instructlons- To what extent does.docx
WHAT IS YOUR CULTURAL INTELLIGENCE- Instructlons- To what extent does.docx
 
What is true about the relative concentration of H+ and OH- in water-.docx
What is true about the relative concentration of H+ and OH- in water-.docxWhat is true about the relative concentration of H+ and OH- in water-.docx
What is true about the relative concentration of H+ and OH- in water-.docx
 
What is the result (in binary) of adding the unsigned char binary numb.docx
What is the result (in binary) of adding the unsigned char binary numb.docxWhat is the result (in binary) of adding the unsigned char binary numb.docx
What is the result (in binary) of adding the unsigned char binary numb.docx
 
What is the resolution of a digital-to-analog converter (DAC)- It is t.docx
What is the resolution of a digital-to-analog converter (DAC)- It is t.docxWhat is the resolution of a digital-to-analog converter (DAC)- It is t.docx
What is the resolution of a digital-to-analog converter (DAC)- It is t.docx
 
What is the primary reason that Earth is cold at the poles and hot at.docx
What is the primary reason that Earth is cold at the poles and hot at.docxWhat is the primary reason that Earth is cold at the poles and hot at.docx
What is the primary reason that Earth is cold at the poles and hot at.docx
 
What is the main differentiating factor of an Advanced Alternative Pay.docx
What is the main differentiating factor of an Advanced Alternative Pay.docxWhat is the main differentiating factor of an Advanced Alternative Pay.docx
What is the main differentiating factor of an Advanced Alternative Pay.docx
 
What is the main difterence between Al- ML- and OL- Select ones a- ML.docx
What is the main difterence between Al- ML- and OL- Select ones a- ML.docxWhat is the main difterence between Al- ML- and OL- Select ones a- ML.docx
What is the main difterence between Al- ML- and OL- Select ones a- ML.docx
 
What is the function of helper T cells in cell mediated immunity- Kill.docx
What is the function of helper T cells in cell mediated immunity- Kill.docxWhat is the function of helper T cells in cell mediated immunity- Kill.docx
What is the function of helper T cells in cell mediated immunity- Kill.docx
 
What is the general FUNCTION of this tissue tvoe- -Pseberbunef that pe.docx
What is the general FUNCTION of this tissue tvoe- -Pseberbunef that pe.docxWhat is the general FUNCTION of this tissue tvoe- -Pseberbunef that pe.docx
What is the general FUNCTION of this tissue tvoe- -Pseberbunef that pe.docx
 
What is the effect of cholesterol on membrane fluidity at physiologic.docx
What is the effect of cholesterol on membrane fluidity at physiologic.docxWhat is the effect of cholesterol on membrane fluidity at physiologic.docx
What is the effect of cholesterol on membrane fluidity at physiologic.docx
 
What is the default IP Prefix for a Class A- -16 124 130 18.docx
What is the default IP Prefix for a Class A- -16 124 130 18.docxWhat is the default IP Prefix for a Class A- -16 124 130 18.docx
What is the default IP Prefix for a Class A- -16 124 130 18.docx
 
What is the biggest animal in the world- What is the only active volca.docx
What is the biggest animal in the world- What is the only active volca.docxWhat is the biggest animal in the world- What is the only active volca.docx
What is the biggest animal in the world- What is the only active volca.docx
 
What is performance- What factors affect performance- What are the dim.docx
What is performance- What factors affect performance- What are the dim.docxWhat is performance- What factors affect performance- What are the dim.docx
What is performance- What factors affect performance- What are the dim.docx
 
What is NOT true about protein migration during polyacrylamide gel ele.docx
What is NOT true about protein migration during polyacrylamide gel ele.docxWhat is NOT true about protein migration during polyacrylamide gel ele.docx
What is NOT true about protein migration during polyacrylamide gel ele.docx
 
What is NOT true about primary protein structures- A- the core of the.docx
What is NOT true about primary protein structures- A- the core of the.docxWhat is NOT true about primary protein structures- A- the core of the.docx
What is NOT true about primary protein structures- A- the core of the.docx
 
What is NOT a mechanism of viral interaction between a receptor and th.docx
What is NOT a mechanism of viral interaction between a receptor and th.docxWhat is NOT a mechanism of viral interaction between a receptor and th.docx
What is NOT a mechanism of viral interaction between a receptor and th.docx
 
What is its quartile range of the data- What is the lower bound- What.docx
What is its quartile range of the data- What is the lower bound- What.docxWhat is its quartile range of the data- What is the lower bound- What.docx
What is its quartile range of the data- What is the lower bound- What.docx
 
What is an action potential- what is its physiological significance-.docx
What is an action potential- what is its physiological significance-.docxWhat is an action potential- what is its physiological significance-.docx
What is an action potential- what is its physiological significance-.docx
 
What is a -mutant- and how is a mutant created- (Please include the SO.docx
What is a -mutant- and how is a mutant created- (Please include the SO.docxWhat is a -mutant- and how is a mutant created- (Please include the SO.docx
What is a -mutant- and how is a mutant created- (Please include the SO.docx
 
What information does UEFI-BIOS report about total memory installed an.docx
What information does UEFI-BIOS report about total memory installed an.docxWhat information does UEFI-BIOS report about total memory installed an.docx
What information does UEFI-BIOS report about total memory installed an.docx
 

Recently uploaded

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
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
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
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxLigayaBacuel1
 
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
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 

Recently uploaded (20)

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 🔝✔️✔️
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
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
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
 
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
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
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🔝
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 

Python File Handling and String Index Errors

  • 1. What will be the result of the following program if there is only one file called myfile.txt in the current directory? try: myfile = open( "myfile.txt") myfile.write( ""*") except: myfile = open("mynewf i le.txt", "w") myfile.write("1") myfile.txt will be opened and 0 will be written in it myfile.txt will be created and 1 will be written in it mynewfile.txt be will opened and 0 will be written in it mynewfile,txt will be created and 1 will be written in it Which error do you expect to encounter when you run the following code? [ begin{array}{l} text { my_sting = "Hello World" } text { print(mystring(14]) } end{array} ] NameEirror: TypeError IndexError