Hint
🧠 Not sure where to start?
Start by asking the user to input a list of numbers, separated by commas:
numbers_input = input("Enter a list of numbers separated by commas: ")
Now you need to convert that input into a list of integers. You can split the string by commas and use a list comprehension:
number_list = [int(n.strip()) for n in numbers_input.split(',')]
Then ask the user for the number they want to count:
target = int(input("Enter the number you want to count: "))
Finally, think about how to count how many times target
appears in number_list
. Maybe there’s a built-in method that can help? Or you can use a loop and a counter!