question archive def backup_file():   """Makes a backup of a file

def backup_file():   """Makes a backup of a file

Subject:Computer SciencePrice:2.86 Bought7

def backup_file():

  """Makes a backup of a file. Your program should

  prompt the user for the name of the file to copy and then write a new file

  with the same contents but with .bak as the file extension

  Args: None

  Return: None

  This should create another file in your folder

  You can use alkaline.txt to create backup alkaline.txt.bak

  """

  # take input from the user asking which file would they like to backup?

  # store the name of file in new variable, filename

  filename = 'alkaline.txt'

  # create new filename with .bak extension by adding filename + '.bak'

  filename = 'alkaline.txt.bak'

  # Open new filename in 'w' mode

  with open filename as f:

  # loop over file you would like to backup

  # use .write() to write each line in old file into new backup file

 

  # close the file

  pass

 

Option 1

Low Cost Option
Download this past answer in few clicks

2.86 USD

PURCHASE SOLUTION

Option 2

Custom new solution created by our subject matter experts

GET A QUOTE

rated 5 stars

Purchased 7 times

Completion Status 100%