Random img but 2 is max

mail@pastecode.io avatar
unknown
python
2 years ago
4.3 kB
3
Indexable
Never
def random_animal():
    animal_images = [bee, chicken, dog, duck, horse, pig, sheep, cat, fish, squirre, turtle, frog, parrot, penguin, giraffe]
    for i in range(30):
        animal_random = random.choice(animal_images)
        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
        if animal_random == animal_images[0]:
            if bee_count == 1 or 2:
                bee_count += 1
                return animal_random
                pass
            elif bee_count == 3:
                animal_random
        if animal_random == animal_images[1]:
            if cat_count == 1 or 2:
                cat_count += 1
                return animal_random
                pass
            elif cat_count == 3:
                animal_random
        if animal_random == animal_images[2]:
            if chicken_count == 1 or 2:
                chicken_count += 1
                return animal_random
                pass
            elif chicken_count == 3:
                animal_random
        if animal_random == animal_images[3]:
            if dog_count == 1 or 2:
                dog_count += 1
                return animal_random
                pass
            elif dog_count == 3:
                animal_random
        if animal_random == animal_images[4]:
            if duck_count == 1 or 2:
                duck_count += 1
                return animal_random
                pass
            elif duck_count == 3:
                animal_random
        if animal_random == animal_images[5]:
            if horse_count == 1 or 2:
                horse_count += 1
                return animal_random
                pass
            elif horse_count == 3:
                animal_random
        if animal_random == animal_images[6]:
            if pig_count == 1 or 2:
                pig_count += 1
                return animal_random
                pass
            elif pig_count == 3:
                animal_random
        if animal_random == animal_images[7]:
            if sheep_count == 1 or 2:
                sheep_count += 1
                return animal_random
                pass
            elif sheep_count == 3:
                animal_random
        if animal_random == animal_images[8]:
            if fish_count == 1 or 2:
                fish_count += 1
                return animal_random
                pass
            elif fish_count == 3:
                animal_random
        if animal_random == animal_images[9]:
            if squirre_count == 1 or 2:
                squirre_count += 1
                return animal_random
                pass
            elif squirre_count == 3:
                animal_random
        if animal_random == animal_images[10]:
            if turtle_count == 1 or 2:
                turtle_count += 1
                return animal_random
                pass
            elif turtle_count == 3:
                animal_random
        if animal_random == animal_images[11]:
            if frog_count == 1 or 2:
                frog_count += 1
                return animal_random
                pass
            elif frog_count == 3:
                animal_random  
        if animal_random == animal_images[12]:
            if parrot_count == 1 or 2:
                parrot_count += 1
                return animal_random
                pass
            elif parrot_count == 3:
                animal_random
        if animal_random == animal_images[13]:
            if pengiun_count == 1 or 2:
                pengiun_count += 1
                return animal_random
                pass
            elif pengiun_count == 3:
                animal_random
        if animal_random == animal_images[14]:
            if giraffe_count == 1 or 2:
                giraffe_count += 1
                return animal_random
                pass
            elif giraffe_count == 3:
                animal_random