This document discusses object oriented programming concepts like classes, objects, encapsulation, and abstraction. It defines classes as blueprints for objects that can contain methods and attributes. Objects are instances of classes that contain the class's methods and properties. Encapsulation is implemented by making fields private and accessing them via public getter and setter methods to protect data. Abstraction exposes only relevant data in a class interface and hides private attributes and methods.
This presentation educates you about objectives of python with example syntax, OOP Terminology, Creating Classes, Creating Instance Objects, Accessing Attributes and Built-In Class Attributes.
This presentation educates you about objectives of python with example syntax, OOP Terminology, Creating Classes, Creating Instance Objects, Accessing Attributes and Built-In Class Attributes.
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
3. 3
Why OOP?
With object oriented programming, the goal is
to encapsulate your code into logical, hierarchical
groupings using classes so that you can reason about your code
at a higher level
4. 4
What is OOP?
Object oriented programming is a method of programming that attempts to
model some process or thing in the world as a class or object. OOP concepts
allow us to create specific interactions between objects. They make it
possible to reuse code without creating security risks or harming
performance and code readability
class - a blueprint for objects. Classes can contain methods (functions) and
attributes (similar to keys in a dict).
instance - objects that are constructed from a class blueprint that contain
their class's methods and properties.
Classes are created by keyword class, Attributes are the variables that
belong to a class.
Attributes are always public and can be accessed using the dot (.) operator.
Eg.: Myclass.Myattribute
5. 5
SELF AND INIT
The self parameter is a reference to the current instance of the class, and is used
to access variables that belongs to the class.
It does not have to be named self , you can call it whatever you like, but it has to
be the first parameter of any function in the class
All classes have a function called __init__(), which is always executed when the
class is being initiated.
Use the __init__() function to assign values to object properties, or other
operations that are necessary to do when the object is being created:
6. 6
Class definition syntax:
Class classname:
Statement-1
#class body
.
Statement-n
An object consists of :
State: It is represented by the attributes of an object. It also reflects the
properties of an object.
Behavior: It is represented by the methods of an object. It also reflects the
response of an object to other objects.
Identity: It gives a unique name to an object and enables one object to interact
with other objects.
class Car:
def __init__(self, name, mileage):
self.name = name
self. mileage = mileage
------------------------------------------------------------
------
obj2 = Car("Honda City",24.1)
7. 7
The methods defined inside a class other than the constructor method are known as
the instance methods. Furthermore, we have two instance methods here- description()
and max_speed(). Let’s talk about them individually-
description()- This method is returning a string with the description of the car
such as the name and its mileage. This method has no additional parameter. This
method is using the instance attributes.
max_speed()- This method has one additional parameter and returning a string
displaying the car name and its speed.
Three important things to remember are-
1. You can create any number of objects of a class.
2. If the method requires n parameters and you do not pass the same number of
arguments then an error will occur.
3. Order of the arguments matters.
9. 9
ENCAPSULATION
Encapsulation helps with data security, allowing you to protect the data stored in a
class from system-wide access. As the name suggests, it safeguards the internal
contents of a class like a capsule.
You can implement encapsulation in Java by making the fields (class variables)
private and accessing them via their public getter and setter methods. JavaBeans are
examples of fully encapsulated classes.
Encapsulation in Java:
Restricts direct access to data members (fields) of a class
Fields are set to private
Each field has a getter and setter method
Getter methods return the field
Setter methods let us change the value of the field
10. 10
The __init__ method :
The __init__ method is similar to constructors in C++ and Java.
It is run as soon as an object of a class is instantiated. The
method is useful to do any initialization you want to do with
your object
Self keyword:
self represents the instance of the class. By using the
“self” we can access the attributes and methods of the class
in python. It binds the attributes with the given arguments.
11. 11
Encapsulation - the grouping of public and private attributes and methods into a
programmatic class, making abstraction possible
ENCAPSULATI
ON
12. 12
ABSTRACTION
Abstraction - exposing only "relevant" data in a class interface, hiding private attributes and
methods (aka the "inner workings") from users