Ad
Code
Diff
  • import random
    
    def returnhundred(s):
        num = 0
        if isinstance(s, str):
            num = len(s)
        while num < 101:
            num += (num +1)
        while True:
            rnd = random.randrange(num)
            if rnd == 100:
                return rnd
    
    • import random
    • def returnhundred(s):
    • #works with s integer
    • if type(s) != int or s == 101 :
    • print(s,"im in")
    • return 100
    • for j in range(0,s):
    • if j == 100:
    • return 100
    • return returnhundred(s+1)
    • num = 0
    • if isinstance(s, str):
    • num = len(s)
    • while num < 101:
    • num += (num +1)
    • while True:
    • rnd = random.randrange(num)
    • if rnd == 100:
    • return rnd