Advertisement
Stosswalkinator

File output of lists in Python 2.7 (Windows)

Jul 15th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. #====================
  2. # Title: [TUTORIAL] File Output of a numbered list
  3. # Description: Find the numbers in a range and output it to a file, along with
  4. # the sum of those numbers.
  5. # Author: Stosswalkinator
  6. # Date: 7/15/2013
  7. #====================
  8.  
  9. lag = []
  10. str(lag.extend(range(0,100,5)))
  11. str(lag.extend(range(0,100,7)))
  12. f = open('C:\Users\user_name\My Documents\python.txt', 'w')
  13. f.write(str(lag))
  14. f.write(str(sum(lag)))
  15. f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement