H3NL3Y

Untitled

Nov 28th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. # WRITING TO A FILE #
  2.  
  3.  
  4. footballfile = open('fbFile.txt' , 'a')
  5.  
  6. name = input('Enter name: ')
  7.  
  8. footballfile.write(name + '\n')
  9. footballfile.write('Man U' + '\n')
  10. footballfile.write('Liverpool' + '\n')
  11. footballfile.write('Everton' + '\n')
  12.  
  13. footballfile.close
  14.  
  15. # READING FROM A FILE #
  16.  
  17. footballfile = open('fbFile.txt' , 'r')
  18. fbInfo = footballfile.read().split('\n')
  19. print(fbInfo[0:4])
Add Comment
Please, Sign In to add comment