Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
4.4 kB
2
Indexable
Never
bee_count = 0
chicken_count = 0
dog_count = 0
duck_count = 0
horse_count = 0
pig_count = 0
sheep_count = 0
cat_count = 0
fish_count = 0
squirre_count = 0
turtle_count = 0
frog_count = 0
parrot_count = 0
pengiun_count = 0
giraffe_count = 0

def random_animal():
    animal_images = [bee, chicken, dog, duck, horse, pig, sheep, cat, fish, squirre, turtle, frog, parrot, penguin, giraffe]
    
    global bee_count
    global chicken_count
    global dog_count
    global duck_count
    global horse_count
    global pig_count
    global sheep_count
    global cat_count
    global fish_count
    global squirre_count
    global turtle_count
    global frog_count
    global parrot_count
    global pengiun_count
    global giraffe_count
    
    for i in range(30):
        animal_random = random.choice(animal_images)
        if animal_random == animal_images[0]:
            bee_count += 1
            if bee_count == 1 or bee_count == 2:
                return animal_random
            elif bee_count == 3:
                animal_random

        if animal_random == animal_images[1]:
            cat_count += 1
            if cat_count == 1 or cat_count == 2:
                return animal_random
            elif cat_count == 3:
                animal_random

        if animal_random == animal_images[2]:
            chicken_count += 1
            if chicken_count == 1 or chicken_count == 2:
                return animal_random
            elif chicken_count == 3:
                animal_random

        if animal_random == animal_images[3]:
            dog_count += 1
            if dog_count == 1 or dog_count == 2:
                return animal_random
            elif dog_count == 3:
                animal_random

        if animal_random == animal_images[4]:
            duck_count += 1
            if duck_count == 1 or duck_count == 2:
                return animal_random
            elif duck_count == 3:
                animal_random

        if animal_random == animal_images[5]:
            horse_count += 1
            if horse_count == 1 or horse_count == 2:
                return animal_random
            elif horse_count == 3:
                animal_random

        if animal_random == animal_images[6]:
            pig_count += 1
            if pig_count == 1 or pig_count == 2:
                return animal_random
            elif pig_count == 3:
                animal_random

        if animal_random == animal_images[7]:
            sheep_count += 1
            if sheep_count == 1 or sheep_count == 2:
                return animal_random
            elif sheep_count == 3:
                animal_random

        if animal_random == animal_images[8]:
            fish_count += 1
            if fish_count == 1 or fish_count == 2:
                return animal_random
            elif fish_count == 3:
                animal_random

        if animal_random == animal_images[9]:
            squirre_count += 1
            if squirre_count == 1 or squirre_count == 2:
                return animal_random
            elif squirre_count == 3:
                animal_random

        if animal_random == animal_images[10]:
            turtle_count += 1
            if turtle_count == 1 or turtle_count == 2:
                return animal_random
            elif turtle_count == 3:
                animal_random
        if animal_random == animal_images[11]:
            frog_count += 1
            if frog_count == 1 or frog_count == 2:
                return animal_random
            elif frog_count == 3:
                animal_random  

        if animal_random == animal_images[12]:
            parrot_count += 1
            if parrot_count == 1 or parrot_count == 2:
                return animal_random
            elif parrot_count == 3:
                animal_random

        if animal_random == animal_images[13]:
            pengiun_count += 1
            if pengiun_count == 1 or pengiun_count == 2:
                return animal_random
            elif pengiun_count == 3:
                animal_random

        if animal_random == animal_images[14]:
            giraffe_count += 1
            if giraffe_count == 1 or giraffe_count == 2:
                return animal_random
            elif giraffe_count == 3:
                animal_random