Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open('numbers.txt') as nmbr:
- #read_data = nmbr.read()
- x=nmbr.readline() #reads the first line
- y=nmbr.readline() #reads the second line
- print(x)
- print(y)
- numbers = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
- myList = []
- for i in x:
- if i in numbers:
- myList.append(int(i))
- print myList
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement