Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # WRITING TO A FILE #
- footballfile = open('fbFile.txt' , 'a')
- name = input('Enter name: ')
- footballfile.write(name + '\n')
- footballfile.write('Man U' + '\n')
- footballfile.write('Liverpool' + '\n')
- footballfile.write('Everton' + '\n')
- footballfile.close
- # READING FROM A FILE #
- footballfile = open('fbFile.txt' , 'r')
- fbInfo = footballfile.read().split('\n')
- print(fbInfo[0:4])
Add Comment
Please, Sign In to add comment