def square(num):
    return num**2
# MAP FUNCTIONS
# my_nums = [1,2,3,4,5]

# for item in map(square, my_nums):
#     print(item)
# print(list(map(square, my_nums)))

# def splicer(mystring):
#     if len(mystring)%2 == 0:
#         return 'even'
#     else:
#         return mystring[0]
#
# mynames = ['A', 'BB', 'CCC','DDDD']
#
# print(list(map(splicer, mynames)))

#FILTER FUNCTION
nums = [1,2,3,4,5,6]
# def check_even(num):
#     return num%2 == 0
# print(list(filter(check_even, nums)))

# LAMBDA EXPRESSION
print(list(map(lambda num: num**2,nums )))


