Guest User

Untitled

a guest
Dec 14th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. open_list = open("my_list.txt")
  2. num_list1 = []
  3.  
  4. for line in open("my_list.txt"):
  5. line = line.strip()
  6. num_list1.append(line)
  7. print(num_list1) # this is printing my list perfect
  8. # ['15,57,14,33,72,79,26,56,42,40'] is what
  9. # prints, which is what im looking for
  10.  
  11.  
  12. temp = num_list1[0] # this is where im running into issues
  13. num_list1[0] = num_list1[2]
  14. num_list1[2] = temp
  15. print(num_list1)
Add Comment
Please, Sign In to add comment