In: Computer Science
times=10
a_val=0
b_val=0
c_val=0
d_val=0
while(times):
cat=str(input("Enter category(A, B, C, D): "))
val=int(input("Enter sales: "))
if cat=='A':
a_val+=val
elif cat=='B':
b_val+=val
elif cat=='C':
c_val+=val
elif cat=='D':
d_val+=val
else:
print("Category invalid. Enter again")
times+=1
times-=1
print("Sales in category A= "+str(a_val))
print("Sales in category B= "+str(b_val))
print("Sales in category C= "+str(c_val))
print("Sales in category D= "+str(d_val))
print("Total sales= "+str(a_val+b_val+c_val+d_val))
#SAMPLE OUTPUT
PLEASE LIKE IT RAISE YOUR THUMBS UP
IF YOU ARE HAVING ANY DOUBT FEEL FREE TO ASK IN COMMENT
SECTION