Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Vamsi

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

INTERNSHIP ON

PYTHON ESSENTIALS
INTERNSHIP INSTRUCTOR: CISCO NETWORKING ACADEMY
PREPARED BY:
KATTAMREDDY VENKATA VAMSI KRISHNA REDDY
222U5A0203
PYTHON ESSENTIALS-1
• Introduction
• Data types
• Loops
• Functions
PYTHON ESSENTIALS-2
• Packages
• Strings
• Object oriented programming
• Miscellaneous
INTRODUCTION
• Python is a high-level programming language known for its simplicity
and readability
• It is easy to learn
• It is an interpreted language
• Python has extensive libraries
• It can be run on any platform
• Python is open source language
DATA TYPES
• The data types in python are:
• Int
• Float
• Str
• Bool
• Variables are used to store data values
• The input and output operations in python is given as:
• Input
• Print
• The operators in python are:
• Arithmetic
• Comparison
• Logical
• assignment
LOOPS
• Boolean values are used in comparisons and logical operations
• True
• False

• Conditional execution:
• if
• elif
• else

• Loops are used to iterate over a sequence until the condition is true
• for
• while

• Logical and bitwise operations


• Logical operations
• And
• Or
• Not
• Bitwise operations
• &(and)
• |(or)
• ^(xor)
• ~(not)
• <<(left shift)
• >>(right shift)
FUNCTIONS
• Functions are reusable blocks of code that performs a specific task
• Tuples are ordered and immutable collection of items. Once created
their elements cannot be changed
• Dictionaries are unordered collections of key-value pair. Each key is
unique and maps to a value
• Data processing involves manipulating and analyzing data structures
like lists, tuples, dictionaries
PACKAGES
• Modules are the files containing python code
• Packages are the collection of related modules. A directory containing
a special __init__.py file
• PIP(python package installer):
• It is a tool for installing and managing python packages
• Pip install package-name
• Pip uninstall package-name
• Pip install –r requirements.txt
STRINGS
• A string is a sequence of characters
• Lower()-converts to lower case
• Upper()-converts to upper case
• Split()-splits string into a list
• Replace()-replaces substrings
• List methods:
• Append()-adds element
• Remove()-removes the first occurrence of element
• Pop()-remove and return the element t the given index
• Exceptions are errors detected during execution
• Handling exceptions
• Catching exceptions
• Raising exceptions
• Custom exceptions
OBJECT ORIENTED PROGRAMMING
• OOP is a programming paradigm that uses “objects” to design
applications and computer programs. It uses several concepts:
classes, objects, inheritance, encapsulation, polymorphism, and
abstraction.
➢Classes and objects:
• Class is a blue print for creating objects
• Object is an instance of class

➢Attributes:
• Instance attributes are the variables that are unique to each instance
• Class attributes are the variables that are shared among all instances of a class
➢Methods
• Instance methods are the functions defined within in a class that operate on instance of that class
• Class methods are the functions operate on the class itself, rather than on instances of the class
• Static methods are the functions defined within in a class that do not operate on instances or the class

➢Encapsulation
• Encapsulation is the bundling of data and methods that operate on that data within one unit

➢Inheritance
• Inheritance allows the class to inherit attributes and methods from another class. The class being
inherited from is called “parent ” class and the class inherits is called “child” class

➢Polymorphism
• Polymorphism allows for methods to be used interchangeably, even if they belong to different classes, as
long as those classes implement the method

➢Abstraction
• Abstraction is the concept of hiding the complex implementation details and showing only the essential
features of the object
MISCELLANEOUS
• File handling
• Opening a file
• Reading from a file
• Writing to a file
• Using with statement
• Comprehensions
• List Comprehensions
• Dictionary Comprehensions
• Set Comprehensions
• Generator expressions
• Lambda functions- anonymous, inline functions defined with lambda
• Map, filter, reduce
• Map()-applies function to all items in an input list
• Filter()-filters items out of a list
• Reduce()- reduces list to a single value
• Decorators- functions that modify the behaviour of other functions
• Iterators- an object that can be iterated upon
• Generators- a function that returns an iterator and produces a sequence of
values
• Context managers- use with statements to manage resources
• Datetime module- it supplies classes for manipulating dates and times in
both simple and complex ways
• Regular expressions- these are the sequence of characters that form search
patterns
• JSON handling- javascript object notation is light weighted data-
interchange format
• Logging- the logging module in python is used to record messages that can
help in diagnosing problems
• Argparse- tis provides way to handle command-line arguments passed to a
python script
• Virtual environments- these are self-contained directories that contain a
python installation for particular version
THANK YOU

You might also like