The document provides an introduction to Python covering essential topics such as keywords, identifiers, data types, operators, functions, classes, and loops. It emphasizes the significance of comments, the usage of variables, and the concept of object-oriented programming including abstraction, polymorphism, encapsulation, and inheritance. Practical examples are presented to illustrate how to use loops and functions effectively in Python.
Why Should We Use Loops? www.edureka.co Supposeyou want to print the numbers from 0-10 0,1,2,3,4,5,6,7,8,9,10 You want to print the sum of all even numbers until 100. You want to print the name of all employees in a sequence until you come across lets say ‘Ravi Mehta’ OR OR
www.edureka.co Why WHILE Loop? Whenwe are executing a set of statements , if the condition holds true. The execution stops as soon as the condition is false.
Why Use Functions? www.edureka.co I haveto write the logic for Factorial again and again Instead You can define a function to calculate factorial. And you can call that function every time you need to calculate factorial.
Why Use Classes? www.edureka.co You candefine a class with various methods/functions You can access and modify the data stored in methods using the object of the class. A class is basically a definition of an object
www.edureka.co Creating a parentclass Inheriting properties to a derived class or child class Base Class Derived Class You can access methods and properties from either classes by creating the objects.