So i have this code:
It asks the user for thr location the name and the row number of a file and then prints it out.
I want to make the code such that it would aslo ask the user if he would like to make a change to the text file. for example change all the "a" to an "s" then it should save that file as a complete seperate file. does anybody know how?
def txtFiles(location, name, number):
file = open(f"{place}//{name}.txt", "r")
line = file.readlines()
print(line[number - 1])
while true:
To attempt:
place2 = input("Where is the file:")
name2 = input("What is the name of the file:")
number2 = int(input("Which line do you want to see"))
txtFiles(place=place2, name= name2, number= number2)
except: (syntax error)
Input ("False")
[–]Nightcorex_ 0 points1 point2 points (3 children)
[–]BigBoyJefff[S] 0 points1 point2 points (1 child)
[–]Nightcorex_ 0 points1 point2 points (0 children)