subject

Ok so im going to list my question and then the work so far. Here is the code so far:(THE PROBLEM WITH THE CODE IS THAT THE IM SUPPOSE TO USE FIND() TO REPEATEDLY CHANGE THE OCCURRENCE OF THE WORD "MASK" TO THE WORD "HAT" IN THE FILE BUT AM KIND OF LOST HAVE BEEN WORKING ON THIS FOR A WEEK AND A HALF) ALSO I CAN NOT use the replace method, count method, split method, range() function, or lists in your solution. HAVE BEEN TRYING TO FIND SUM WAY TO USE FIND() BUT AM COMING UP SHORT

CODE:

#Get input file name

fileOne = input("Enter the input file name :")

#Get output file name

fileTwo = input("Enter the output file name :")

'''Get a string that will be searched in the source file

to locate all occurrences of the string'''

targetString = input("Enter the target string :")

'''Get a string that will replace each occurrence of the target

string in the source file'''

replacementString = input("Enter the replacement string :")
files =input("Enter a file with the word 'mask':")
#Open the input file in read mode

f1 = open(fileOne,"r+")

#Read the content of input file

content =f1.read()

#Replace the target string with the replacement string
content =f1.find('mask')
print(files[0:content]+ "hat"+ files[content +content:len(files)])
#Open the output file in write mode

f1 = open(fileTwo,"w")

'''Write the content after all of the occurrences of the target

string have been found and replaced by the replacement string'''

f1.close()


Ok so im going to list my question and then the work so far.

Here is the code so far:(THE PROBLEM
Ok so im going to list my question and then the work so far.

Here is the code so far:(THE PROBLEM

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:40
Write a program that defines symbolic names for several string literals (chars between quotes). * use each symbolic name in a variable definition. * use of symbolic to compose the assembly code instruction set can perform vara = (vara - varb) + (varc - vard); ensure that variable is in unsigned integer data type. * you should also further enhance your symbolic logic block to to perform expression by introducing addition substitution rule. vara = (vara+varb) - (varc+vard). required: debug the disassembly code and note down the address and memory information.
Answers: 3
question
Computers and Technology, 23.06.2019 11:00
Describe three characteristics of at-risk drivers. a. b. c. describe three characteristics of safe drivers. a. b. c. describe three driver errors that could cause a collision. a. b. c. how will this information affect you as a driver now and in the future? (2-3 sentences)
Answers: 2
question
Computers and Technology, 24.06.2019 01:30
Suppose a cpu with a write-through, write-allocate cache achieves a cpi of 2. what are the read and write bandwidths (measured by bytes per cycle) between ram and the cache? (assume each miss generates a request for one block.)
Answers: 1
question
Computers and Technology, 24.06.2019 06:30
Ineed to know the anwser to all these questions
Answers: 2
You know the right answer?
Ok so im going to list my question and then the work so far. Here is the code so far:(THE PROBLEM W...
Questions
question
Biology, 04.07.2019 11:30
Questions on the website: 13722359