I’m new to Data analytics, and i’m trying to create an output of 3 bins in python. I’ll have my code attached below. I my getting an output, but its not in 3 bins. Also the bins are as follows:
Question: The function must iterate over the scores in score_list and bin them into three bins:
Negative (scores of 1-5)
Neutral (scores of 6-8)
Positive (scores of 9-10)
create score_list from customer submitted scores
The function must iterate over 3 bins
The output of the function must be three statements.
# Define a function score_counter
score_list = [1,2,3,4,5,6,7,8,9,10]
for score_counter in range(1, 11):
if score_counter <= (5):
print('Negative: ' + str(score_counter))
elif score_counter == (6):
print('Neutral: ' + str(score_counter))
elif score_counter == (7):
print('Neutral: ' + str(score_counter))
elif score_counter == (8):
print('Neutral: ' + str(score_counter))
else:
print('Positive: '+ str(score_counter))
print()