Hi,
I have installed python 3.6.0 on my laptop and using IDLE to write below program
but i am getting syntax error.
Can you suggest please >
Write a Python program to count the number 4 in a given list.
Program-
I have installed python 3.6.0 on my laptop and using IDLE to write below program
but i am getting syntax error.
Can you suggest please >
Write a Python program to count the number 4 in a given list.
Program-
def list_count_4(nums): count = 0 for num in nums: if num == 4: count = count + 1 return count print(list_count_4([1, 4, 6, 7, 4])) print(list_count_4([1, 4, 6, 4, 7, 4]))