Ad

Now the function returns test instead of giving an error.

Code
Diff
  • def return_test():
        return 'test'
    • Test
    • def return_test():
    • return 'test'

I added a bit more to it. I'm not sure, is it unethical to fork my own code? Also I feel like there isn't much point in this after I added "age % 1" to the original one. Feel free to remove that and think of something more creative if you are forking it.

Code
Diff
  • def takeYourAge(age):
        import math
        age *= 3
        age %= 1.233
        age **= 100
        age *= 1000000
        age // 0.2
        age ** 1 ** 8
        age %= 1
        age = math.floor(age)
        age += 21
        
        
        return age
    • def takeYourAge(age):
    • import math
    • age *= 3
    • age %= 1.233
    • age **= 100
    • age *= 1000000
    • age // 0.2
    • age ** 1 ** 8
    • age %= 1
    • age = math.floor(age)
    • age += 21
    • return age

I added a few other things to say hello to.

Code
Diff
  • ## Created by RHB
    people = ["Mr. Beast", "sigma", "world"]
    for person in people:
        print("Hello " + person)
    • ## Created by RHB
    • # Your code here
    • print("Hello World")
    • people = ["Mr. Beast", "sigma", "world"]
    • for person in people:
    • print("Hello " + person)

This kumite is similar to one of those things where you take your age and do a lot of things to it. I wanted to see how many steps we can get and then return an answer of 21. Use as many functions as you can.

def takeYourAge(age):
    import math
    age *= 3
    age %= 1.233
    age **= 100
    age *= 1000000
    age %= 1
    age = math.floor(age)
    age += 21
    
    
    return age

I fixed the typo in the title, and also added a pass to the preloaded code to prevent errors.

Code
Diff
  • def is_more_than_2(n):
        return n > 2

I added 100 test cases, and put in the preloded code.

Added Testcases, and also made it so that it knew that 9+10=21 like from the meme.

Code
Diff
  • def testFunction(n):
        if n == 9 + 10:
            return 21 #haha funny number
        return eval(str(n))
    • def test(n):
    • return eval(n)
    • def testFunction(n):
    • if n == 9 + 10:
    • return 21 #haha funny number
    • return eval(str(n))

I changed the program so it does the modulation with a while loop.

Code
Diff
  • import random
    import time
    def not_even(n):
        pizza_time = time.ctime()
        while n > 1:
            n -= 2
        if n == 0:
            return 'its not even', pizza_time
        else:
            return 'its still not even', pizza_time
        return pizza_time
    n = random.randint(0, 10000)
     
    print(not_even(n))
    • import random
    • import time
    • def not_even(n):
    • pizza_time = time.ctime()
    • if n % 2 == 0:
    • while n > 1:
    • n -= 2
    • if n == 0:
    • return 'its not even', pizza_time
    • else:
    • return 'its still not even', pizza_time
    • return pizza_time
    • n = random.randint(0, 10000)
    • print(not_even(n))

Creates a fixed test for the denominator being zero, and makes it so that when it is zero None is returned.

Code
Diff
  • def division(a, b):
        if b == 0:
            return None
        return a / b
    • def division(a, b):
    • if b == 0:
    • return None
    • return a / b

I fixed the error in the test cases, and I added 99 more test cases that all are the same thing.