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 integerif type(s) != int or s == 101 :print(s,"im in")return 100for j in range(0,s):if j == 100:return 100return 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