Help with my code

Hey guy’s I having trouble with my code in Shrapnel and it passes but I do not make any explosions here is my code

while True:
enemy = hero.findNearestEnemy()
if enemy:
distance = hero.distanceTo(enemy)
if distance == hero.throwRange:
hero.throwRange - 15
else:
hero.attack(enemy)
If somone could figure out why please show me and thanks

can you first please format your code correctly, you just need to click that symbol </> then paste your code in the word type or paste code here

assuming that your code is like this after formatting

while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        distance = hero.distanceTo(enemy)
        if distance == hero.throwRange:
            hero.throwRange - 15
        else:
            hero.attack(enemy)

then you should change those 2 lines

if distance == hero.throwRange:
    hero.throwRange - 15

to

if distance <= hero.throwRange:
    hero.throw(enemy)

because in the first line you are checking only if the distance exactly equals your throw range, but it can also be less than your throw range and it will work, then in the second line you are trying to decrease your throw range by 15, which i don’t under stand why you did this, you don’t need to decrease your throw range, even if you try it won’t be decreased, but you need to throw the enemy, so you need to use hero.throw(enemy)