+ 2
How would I solve this problem using an if statement. Please and Thank you.
require 'csv' total_sales = 0 CSV.foreach('sales-data.csv', headers: true, converters: :all) do |row| # TODO: check if category is "Music" (row[2]) # TODO: if it is music, add total_sales + the row's sales (row[6]) end puts total_sales.round(2)
1 ответ
+ 1
If nobody knows here in sololearn, try using stack overflow website