Home/Support/Support Forum/vertically print with counter element and turn it into symbol
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

vertically print with counter element and turn it into symbol

0 votes
i want my output to be like this:
a: **

b: *

c: **

each '*' represents a value of 1. my code gives me this:{a: 2, b: 1, c: 2}

from collections import Counter
reports = 0
graph1 = []
print("Enter in this format: # of reports, StartDate, EndDate. E.g. 5 20200401 20200403")
nor, start, end = input().split()
nor = int(nor)
print("Enter in this format: LabID, Date, # of cases. E.g. IWK 20200401 1")
while reports < nor:
place, date, noc = input().split()
graph1.append(int(date))
reports = reports + 1
graph1.sort()
a = dict(Counter(graph1))
print(a)
i tried doing this: print(* a, sep='\n') this makes the stuff in the list output vertically but it doesn't output the counter and is there a way to change the 2, 1, 2 into '*'
https://bit.ly/3iZ3cZD
asked Aug 31 in Python by jainsaniya New to the Community (0 points)

Please log in or register to answer this question.

...