Let's Print Something!

Allow me to demonstrate the print() function in python!

var = "World!"
print("Hello " + var)
Hello World!

Let's Print some more!

Loops are really fun sometimes, let's say it a couple more times 🔁

for i in range(5):
    print("Hello " + var)
Hello World!
Hello World!
Hello World!
Hello World!
Hello World!

Have a Bogosort algorithm!

The real question is what time complexity this algorithm has 🤔

from random import shuffle as sh

def sorted(arr):
    length = len(arr)
    for i in range(0, length-1):
        if (arr[i] > arr[i+1] ):
            return False
    return True

def shuffle(arr):
    sh(arr)


def Bogosort(arr):
    while not sorted(arr):
        shuffle(arr)
    return arr

array = [23,10,49,9]
print(Bogosort(array))
[9, 10, 23, 49]