Nov-16-2016, 12:06 AM
Good Evening,
I'm stuck in a headache and am looking to get some solutions. I've been given a problem that wants me to input 9 integers, and list the occurrences of those 9 integers. I've done it one way but the tool our class uses called 'Livelab' doesn't accept the code I gave it. For this purpose I will show both source code.
For the rejected code I used:
I'm stuck in a headache and am looking to get some solutions. I've been given a problem that wants me to input 9 integers, and list the occurrences of those 9 integers. I've done it one way but the tool our class uses called 'Livelab' doesn't accept the code I gave it. For this purpose I will show both source code.
For the rejected code I used:
from collections import Counter a = [2, 5, 6, 5, 4, 3, 23, 43, 2] print(Counter(a))The code I'm working on currently looks like this. I've got some of the print statements to work within Idle, but am having trouble and the book I have has been little help.
for i in range(9): num_list = int(input("Enter integers between 1 and 100: ")) print(num_list.count(2)) print(num_list.count(5)) print(num_list.count(6)) print(num_list.count(4)) print(num_list.count(3)) print(num_list.count(23)) print(num_list.count(43))Any help would be appreciated!