def myfun(num): count = 0 for x in num: if x == 4: count = count + 1 return count if __name__=="__main__": print(myfun([1, 4, 6, 7, 4])) print(myfun([1, 4, 6, 4, 7, 4]))
2 3
Apply For Job
Java Material
Python Material
PLSQL Material
.Net Material
Write a Python program that accepts a sequence of comma-separated numbers from the user and generates a list and a tuple of those numbers.
Write a Python program that calculates the area of a circle based on the radius entered by the user.
Write a Python program to calculate the number of days between two dates.
Write a Python program that accepts an integer (n) and computes the value of n+nn+nnn.
Write a Python program to calculate the sum of three given numbers. If the values are equal, return three times their sum.