Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inp = []
- try:
- f = open("6.txt", "r")
- data = f.read()
- inp = data.split()
- f.close()
- except:
- print("No file")
- # from the beginning
- while int(inp[0]) == 0:
- inp.pop(0)
- # the same from the end
- L = len(inp)
- while int(inp[L-1]) == 0:
- inp.pop(L-1)
- L -= 1
- print(str(inp) + "\n\n-----")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement