Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

recursive python

import random


def guess(a,b):
    x = random.randint(a,b)
    return x


def check(x,y):
    if y ** 2 == x:
        return True
    return False


x = 100
left, right = 0, x
y = guess(left, right)
while not check(x,y):
    y = guess(left, right)
print(y)
Source by app.finxter.com #
 
PREVIOUS NEXT
Tagged: #recursive #python
ADD COMMENT
Topic
Name
4+6 =