• + 0 comments

    PYTHON If in dought pls ask

    def howManyGames(p, d, m, s):
        # Return the number of games you can buy
        games=0
        i=0
        while s>=0:
            cost=p-d*i
            if cost>m:
                s-=cost
            else:
                s-=m
            games+=1
            i+=1
        return games-1