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 to get n (non-negative integer) copies of the first 2 characters of a given string. Return n copies of the whole string if the length is less than 2.
Write a Python program that checks whether a specified value is contained within a group of values.
Write a Python program to get the volume of a sphere with radius six.
Write a Python program to calculate the number of days between two dates.
Print out a set containing all the colors from a list which are not present in other list