Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Topic: strings and text files 11) What happens if you try to open a file for reading and you misspell the filename? 12) What happens

Topic: strings and text files image text in transcribed
11) What happens if you try to open a file for reading and you misspell the filename? 12) What happens if you try to open a file for writing and you misspell the filename? 13) Wh at happens if you want to open a file for reading, but you use 'w' when you call the open function? 14) Why should you always close files when you are finished using them, especially files that you are writing to? 15) 'sentence' is a string variable that contains the following text: Can you here me now? Write a segment of code that will correct the word error, so that sentence contains: Can you hear me now? 16) Using the variable named 'sentence' in question 15), write a segment of code that will count how many words are in the string. You can assume that there is one space character between each word. 17) How many times is the word "Hello" printed by the code below? for vall in range (3): for val2 in range (4): print("Hello")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions