79357589

Date: 2025-01-15 09:07:56
Score: 0.5
Natty:
Report link

0

d=[]

import random

for n in range(100):

d.append(random.randint(1,10))

print(d)

for i in range(10):

print("The number of",str(i)+"'s","in the list is",d.count(i))

Your code is incorrect. You are using [1] instead of 1. It looks for lists rather than integers. The corrected code checks the integers. Because of the difference between the type of variables, it gives you a logical error. A logical error is unrelated to a computer saying that it has an error. It means it gives you the wrong output.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Pin Side