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