IniziaInizia gratis

Tax calculations

It's possible to use vectorized operations to calculate taxes for the liquor, restaurant, and department store industries! We'll simplify the tax calculation process here and assume that government collects 5% of all sales across these industries as tax revenue.

Your task is to calculate the tax owed by each industry related to each month's sales. numpy is loaded for you as np, and the monthly_sales array is available.

Questo esercizio fa parte del corso

Introduction to NumPy

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Create an array of tax collected by industry and month
tax_collected = ____
print(tax_collected)
Modifica ed esegui il codice