Advertisement
Guest User

Untitled

a guest
Dec 19th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. import random
  2. f=open(__file__,"r")
  3. lineList=f.readlines()
  4. s=lineList[len(lineList)-1]
  5. s=sum(map(int,s[3:].split('+')))
  6.  
  7. print(s)
  8. with open(__file__,'a') as f:
  9. if random.randint(0,s) > s//2:
  10. f.write("+{}".format(random.randint(0,s//2)))
  11. else:
  12. f.write("+{}".format(random.randint(s//2,s)))
  13. f.close()
  14.  
  15. s= 1+0+0+0+0+1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement