There are a few silly mistakes in your Python code as well as some styling error (but we are not going there, as it's not that important).
The mistake includes, you are using same variable for iteration variable as well as for iterable, it can create major confusion when using the iterable for future use, and you might get int instead of tuple.
Also, side note, list comprehension has variable in local scope instead of global, so it will not create confusion, but still I recommend changing the iteration varable name.
@Green Cloak Guy have already stated the answer, but it can be improvised using list comprehension. It also helps in usage of slightly less memory than that of list, less usage of lines and also less time consumption. I would suggest using array by numpy, but let's leave it.
print([f'{packs * prices[0]:.2f}' if packs < 35 else f'{(int(math.floor(packs / 36)) * prices[1]) + ((packs % 36) * prices[0]):.2f}' for packs in packs_purchased])
OUTPUT:
>>> [42.50, 25.50, 125.00]
The output above is called list and not what you have stated in your desired output.
If you want that output, you can do, just what @Green Cloak Guy did, but still here's an example:
CREATED_LIST = [f'{packs * prices[0]:.2f}' if packs < 35 else f'{(int(math.floor(packs / 36)) * prices[1]) + ((packs % 36) * prices[0]):.2f}' for packs in packs_purchased]
print(f'packs_spent({", ".join(CREATED_LIST)})')
OUTPUT:
>>> packs_spent(42.50, 25.50, 125.00)
packs_spentto a list, and return that at the end.for packs_purchased in packs_purchased:. Use something likefor pack in packs_purchased:instead.packs_spent(42.50, 25.50, 125.00)is not a list.