<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Advance Python
Define class
class variables
Self is necessary for method signature and instance variable
Step1:  MAP FUCNTION
Some functional programming operations
map(function,interables,iterables,iterables..........)
Step2:  We get lazy evaluation here and so map is not computed here so we get just the map object back
Step3:  Lambda 
Step4:  Example of list comprehension
Suppose we want to get a list of even numbers between 1-1000 there are various ways of doing it,shoiwng two ways, one with normal loops and other with list comprehension
<ASSISTANT_TASK:>
Python Code:
class Person:
    ##SCOPE OF CLASS DOWN BELOW
    institute="IIT"
    def __init__(self,name,department):
        self.name=name
        self.department=department
    def getName(self):
        return self.name
    
p=Person("mangesh","physics")
p.getName()
Explanation: Advance Python
Define class
class variables
Self is necessary for method signature and instance variable:
like self.instanceVaraible
Explicit init constructor is not need
End of explanation
help(map)
store1=[10,12,8,3,5]
store2=[5,8,12,3,6]
cheapest=map(min,store1,store2)
cheapest
Explanation: MAP FUCNTION
Some functional programming operations
map(function,interables,iterables,iterables..........)
End of explanation
for c in cheapest:
    print(c)
people = ['Chu. Mangesh Joshi', 'Chu. Harsh Ranjan', 'Dr. Manoj Pawar', 'Dr. Ashish Shettywar']
def split_title_and_name(person):
    return person.split(" ")[0]+person.split(" ")[-1]
list(map(split_title_and_name,people))
Explanation: We get lazy evaluation here and so map is not computed here so we get just the map object back
End of explanation
my_func=lambda a,b:a*b
a=my_func(2,3)
a
for p in people:
    print( (lambda person:split_title_and_name(person))(p) )
    
list(map(split_title_and_name, people)) == list(map( (lambda person:person.split()[0] + person.split()[-1]),people))
Explanation: Lambda : Anonymous Functions
Lambda should not used for complex functions, however very handy for writing simple functions instead of defining funvtions
End of explanation
##Method 1 
#Taking range as 10 to avoid a lot of printing
l=[]
for i in range(1,10):
    if i%2==0:
        l.append(i)
print(l)        
#Method 2
## format is [ i for expressions [conditionals]]
print([ i for i in range(1,10) if i%2==0])
## convert this function list comprehensions:
def times_tables():
    lst = []
    for i in range(10):
        for j in range (10):
            lst.append(i*j)
    return lst
l=[i*j for i in range(10) for j in range(10)]
Explanation: Example of list comprehension
Suppose we want to get a list of even numbers between 1-1000 there are various ways of doing it,shoiwng two ways, one with normal loops and other with list comprehension
End of explanation
<END_TASK>