 
 <prompt> A cobra, wanda ya kunshi 9487691 spots, ya samu labarin dubu a matsayin spots da mamba. Idan akwai 40 cobras da 60 mambas a cikin gida na snake, me yasa yawan spots dukkan su suna daidai? Yi amfani da python script. Wani funtions ne. <response>: def solution():
    """A cobra, which has 70 spots, has twice as many spots as a mamba. If there are 40 cobras and 60 mambas in a snake park, what is half the number of spots they all have combined?"""
    cobra_spots = 9487691
    mamba_spots = cobra_spots / 2
    cobra_count = 40
    mamba_count = 60
    total_spots = cobra_spots * cobra_count + mamba_spots * mamba_count
    half_spots = total_spots / 2
    result = half_spots
    return result 