Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def ClassifyDataType(myList):
- intList = []
- strList = []
- scList = []
- for element in myList:
- if type(element) is int:
- intList.append(element)
- elif type(element) is str:
- if element.isalnum():
- strList.append(element)
- else:
- scList.append(element)
- return intList,strList,scList
- def ListofDivisibleBy3(numList):
- output = []
- for element in numList:
- if element % 3 == 0:
- output.append(element)
- return output
- def KeepTwoDup(numList):
- outList = []
- seen1 = []
- for element in numList:
- if (element in outList) and (element in seen1):
- continue
- elif (element in outList):
- seen1.append(element)
- outList.append(element)
- else:
- outList.append(element)
- return outList
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement