Develop a python application that will randomly select n intergers from 1 to 9 and will count and the numbers of accurance of the numbers without using the counter from collection library.
Sample output 1:
How many numbers?; 5
[4, 6, 8, 3, 3]
1-4
1-6
2-3
Sample output 2
How many numbers?: 7
[2, 6, 8, 2, 1, 1 , 6]
2-2
2-6
1-8
2-1
import random
def pri_ran(x,y):
return [random.randint(start, end) for _ in range(n)]
Comments
Leave a comment