hyperion101010

Untitled

Dec 11th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import requests as r
  2. import re
  3. data = "https://recruit.journeylabs.io/getNumber?number="
  4. a=2
  5. b=3
  6. c=0
  7. var = 0
  8. term_count=4 # since 1 is 1st term , 2 is second thus c=8 is 5th term
  9. flg=0
  10. while flg!=1:
  11. c=a+b
  12. var = r.post(url=data+str(a+b),data={}) #sending respsonses as fibonacci terms
  13. var=var.text
  14. if len(re.findall(r"^\D",str(var)))>0: #check that if is it alphabet , if alphabet then response is answer
  15. flg=1
  16. a=b #incrementing fibonacci term
  17. b=c
  18. term_count+=1 #count the term number
  19. print (var," for the term",term_count) #found answer
Add Comment
Please, Sign In to add comment