Python Essentials – 11/08/2021

Variables

  • A variable is a mapping b/w a name and object at a certain location in the computers memory
number = 5
  • A variable name and value 5 is stored in memory
  • Python keeps track of mapping b/w name number and location of the value using Namespaces.
  • We can think of namespaces as dictionaries with names as keys and locations in memory as values
number = 5
other_number = number
some_other = 4
#dict

['number'] = 123456
['other_number] = 123456
['some_other'] = 123457

Lambda Functions

  • Lambda functions are small anonymous functions that can be defined in a simple one line syntax
lambda arguments:expression
  • Mapping with Lambda Functions: map is a special function in python that applies a given function to all items in a list
  • Filters with Lambda function: The filter is another special function that like map takes a function and iterables as inputs. It returns the elements for which function returns true
  • Refer Here for all the samples done in the class.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner