I am trying to create a function which would take a list and be able to count the number of ints floats and str in that list.
output should be:
freq = countDataTypes(list)
any help would be greatly appreciated
>>> def countDataTypes(aList): rtnlist = [0,0,0] for x in aList: if type(x) is string:
the rtnlist[0,0,0] is what this will return. if there are 2 ints, 1 float and 0 str then rtnlist[2,1,0]