Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open_list = open("my_list.txt")
- num_list1 = []
- for line in open("my_list.txt"):
- line = line.strip()
- num_list1.append(line)
- print(num_list1) # this is printing my list perfect
- # ['15,57,14,33,72,79,26,56,42,40'] is what
- # prints, which is what im looking for
- temp = num_list1[0] # this is where im running into issues
- num_list1[0] = num_list1[2]
- num_list1[2] = temp
- print(num_list1)
Add Comment
Please, Sign In to add comment