Get the sum of the positive monthly sales which are stored


Problem

Use Python Programing Language

Problem I

Use a for loop to get the sum of the numbers in my_list, assign the result to sum_value and print it.

my_list = [45, 57.5, 231.4, -56, 99.3, 132, 89.5]
sum_value = 0
###
### YOUR CODE HERE
###

Problem II

Use a for loop to get the sum of the quarterly sales which are stored as values in the sales_quarterly dictionary, assign the result to sum_quarterly, and print it. Note: Print the final sum value only once.

sales_quarterly = {'Q1': 4357, 'Q2': 4652, 'Q3': 3838, 'Q4': 5172}
sum_quarterly = 0
###
### YOUR CODE HERE
###

Problem III

Use a for loop to print all integer numbers between 1 to 30 (inclusive), but skip the ones that are divisible by 7, such as 7, 14, 21, 28.

Problem IV

Use a for loop to get the sum of the positive monthly sales which are stored as values in the sales_monthly dictionary. If your loop encounters a negative value, it should print a message telling the user the month in which the negative value occured and then terminate the loop. Sum up the sales before the negative value was encountered, assign the result to sum_before_negative, and print it.

sales_monthly = {'Jan': 4458, 'Feb': 4532, 'Mar': 4478, 'Apr': -4382}
sum_before_negative = 0
###
### YOUR CODE HERE
###

Problem V

Use a for loop to get the sum of the positive monthly sales which are stored as values in the sales_monthly dictionary. If your loop encounters a negative value, it should print a message telling the user the month in which the negative value occured and skip adding that negative value to the sum. Assign the result to sum_without_negative, and print it.

sales_monthly = {'Jan': 4458, 'Feb': 4532, 'Mar': 4478, 'Apr': -4382, 'May': 4129, 'June': 4398}
sum_without_negative = 0
###
### YOUR CODE HERE
###

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Get the sum of the positive monthly sales which are stored
Reference No:- TGS03249145

Expected delivery within 24 Hours