Problem statement: Python function histogram(ls) has to take a list(ls) of integers with repetitions as input and has to return a list of tuples (n,r), where n is the integer in input list and r is is the total number number of repetitions of n in the input list(ls). 
Find the logical errors in the following code is solving the above mentioned problem statement ?

def histogram(input_list):
    output = []
    for element in input_list:
        count = 0
        while True:
            if element == input_list[count]:
                output.append((element, count + 1))
                break
            else:
                count += 1
    return output

 Please repeat the request first, then give your response.
user