# -*- coding: utf-8 -*-
"""
Created on Wed Jul 25 11:49:31 2018

@author: user
"""

string = input("enter the string to be appended: ")
try:
    with open("C:/Users/user/Desktop/DigitalAlpha/file.txt", "a+") as f: 
        f.write(string)
        
    with open("C:/Users/user/Desktop/DigitalAlpha/file.txt", "r+") as f:
        print("Content:")
        print(f.read())

except IOError:
    print("File does not exist")
    
898506ea55bc282819bb7f4fc4c0322c11806957
<mask token>

<mask token>
try:
    with open('C:/Users/user/Desktop/DigitalAlpha/file.txt', 'a+') as f:
        f.write(string)
    with open('C:/Users/user/Desktop/DigitalAlpha/file.txt', 'r+') as f:
        print('Content:')
        print(f.read())
except IOError:
    print('File does not exist')

<mask token>
string = input('enter the string to be appended: ')
try:
    with open('C:/Users/user/Desktop/DigitalAlpha/file.txt', 'a+') as f:
        f.write(string)
    with open('C:/Users/user/Desktop/DigitalAlpha/file.txt', 'r+') as f:
        print('Content:')
        print(f.read())
except IOError:
    print('File does not exist')

# -*- coding: utf-8 -*-
"""
Created on Wed Jul 25 11:49:31 2018

@author: user
"""

string = input("enter the string to be appended: ")
try:
    with open("C:/Users/user/Desktop/DigitalAlpha/file.txt", "a+") as f: 
        f.write(string)
        
    with open("C:/Users/user/Desktop/DigitalAlpha/file.txt", "r+") as f:
        print("Content:")
        print(f.read())

except IOError:
    print("File does not exist")
    