SlideShare a Scribd company logo
1 of 8
Download to read offline
Strings
Numbers
Booleans
“Hello
World”
-12 3.14
5+0j
True
False
Menard Maranan
-Textual Data
-Inside
Quotation
Marks “ ”
-3 Numerical
Data
-int, float,
complex
-2 Boolean
Values
-True and
False
Menard Maranan
https://www.youtube.com/channel/UC28oX1455dR2OF72o1DU80w/
What?
How?
Why?
data = [
2, True]
age = 20
print(age)
me = “Nard”
print(
“Hi”, me)
Menard Maranan
-Stores Data
Values
-Use Alias for
Naming.
-Pass Data
Values
-Call name to
Use on code
-Shorter
Codes
-Saves Time
Menard Maranan
https://www.youtube.com/channel/UC28oX1455dR2OF72o1DU80w/
List
Dictionary
data = [
1, “Hi”, True
]
info = {
“Name”: “Menard”,
“Age”: 20
}
coordinates = (
12, 98, -23
)
Menard Maranan
Menard Maranan
https://www.youtube.com/channel/UC28oX1455dR2OF72o1DU80w/
Set
numbers = {
9, 2, 4, 2
}
Tuple
-Inside
Brackets []
-Comma
Separated
-Inside Braces {}
-Keyword-Value
Pairs
-Inside
Parenthesis ()
-Comma
Separated
-Immutable
-Inside Braces {}
-Comma
Separated
-Auto Sort &
Unique Values
if else
while loop
for loop
sunny = True
if sunny:
print(“Need Hat”)
else:
print(“No need”)
num = 10
while num != 0:
print(num)
num -= 1
for x in range(10):
print(x)
Menard Maranan
-Logical
Control Flow
-Uses
Condition/s
-Uses
Condition/s
to loop on a
code/s
-Uses
Iteration to
Loop on a
code/s
Menard Maranan
https://www.youtube.com/channel/UC28oX1455dR2OF72o1DU80w/
Modes
file.read()
fileWrt.write()
fileApd.write()
sound.write()
Menard Maranan
Menard Maranan
https://www.youtube.com/channel/UC28oX1455dR2OF72o1DU80w/
file.close()
fileWrt.close()
fileApd.close()
sound.close()
MethodsMethods:
file.read()
fileWrt.write()
open()
-Open files
through
Python Code
Characters:
‘r’ read
‘w’ write
‘a’ append
‘b’ binary
-Closes the
opened File
inside
Python code
close()
file = open(
“file.txt”, “r”)
fileWrt = open(
“file.txt”, “w”)
fileApd = open(
“file.txt”, “a”)
sound = open(
“sound.mp3”, “b”)
except
try:
answer = 4 / 0
except ZeroDivisionError:
print(“INVALID”)
else:
print(answer)
Menard Maranan
Menard Maranan
https://www.youtube.com/channel/UC28oX1455dR2OF72o1DU80w/
finally:
print(“Always Executed”)
else
-Codes written
inside were to
be validated
if no error/s.
-When an error
(exception) is
raised, codes
it hold were
executed.
-If no error
(exception) is
raised, codes
it hold were
executed.
-Codes it hold will
always be executed
regardless if there’s
an error or none.
try
finally
What?
How?
Why?
def greet(name):
return f‘Hi {name}!’
print(greet(“Menard”))
>>>Hi Menard!
print(greet(“Michael”))
print(greet(“Leonel”))
print(greet(“Melanie”))
print(greet(“Leonard”))
Menard Maranan
-Takes input
(or not),
spits output
(or not)
-Independent
from a Class.
-Create it &
Call it; with
or without
argument
(input); as
many times
as you want
-To Organize
Codes.
-Saves time
from
repeated
coding.
Menard Maranan
https://www.youtube.com/channel/UC28oX1455dR2OF72o1DU80w/
class
method
inheritance
class Compute(Calculate):
def __init__(self, x, y):
self.x = x
self.y = y
print(Compute(9, 2).root())
Menard Maranan
-Also called as
Objects
-A collection
of methods
-Organizes
codes
Menard Maranan
https://www.youtube.com/channel/UC28oX1455dR2OF72o1DU80w/
-Similar to
Functions
-Dependent
to a Parent
Class
-Used to pass
codes from
one class to
another
class Calculate:
def __init__(self, x, y):
self.x = x
self.y = y
def root(self):
return pow(self.x, (1 / self.y))
class Calculate:
def __init__(self, x, y):
self.x = x
self.y = y

More Related Content

More from Menard Maranan

Python while loops (menard maranan)
Python while loops (menard maranan)Python while loops (menard maranan)
Python while loops (menard maranan)Menard Maranan
 
Python if else statements (menard maranan)
Python if else statements (menard maranan)Python if else statements (menard maranan)
Python if else statements (menard maranan)Menard Maranan
 
Python tuples (menard maranan)
Python tuples (menard maranan)Python tuples (menard maranan)
Python tuples (menard maranan)Menard Maranan
 
Python sets (menard maranan)
Python sets (menard maranan)Python sets (menard maranan)
Python sets (menard maranan)Menard Maranan
 
Python dictionaries (menard maranan)
Python dictionaries (menard maranan)Python dictionaries (menard maranan)
Python dictionaries (menard maranan)Menard Maranan
 
Python nested lists (menard maranan)
Python nested lists (menard maranan)Python nested lists (menard maranan)
Python nested lists (menard maranan)Menard Maranan
 
Python lists (menard maranan)
Python lists (menard maranan)Python lists (menard maranan)
Python lists (menard maranan)Menard Maranan
 
Python data structures (menard maranan)
Python data structures (menard maranan)Python data structures (menard maranan)
Python data structures (menard maranan)Menard Maranan
 
Python string formatting (menard maranan)
Python string formatting (menard maranan)Python string formatting (menard maranan)
Python string formatting (menard maranan)Menard Maranan
 
Python comments (menard maranan)
Python comments (menard maranan)Python comments (menard maranan)
Python comments (menard maranan)Menard Maranan
 
Python indexing (menard maranan)
Python indexing (menard maranan)Python indexing (menard maranan)
Python indexing (menard maranan)Menard Maranan
 
Slides python booleans (menard maranan)
Slides   python booleans (menard maranan)Slides   python booleans (menard maranan)
Slides python booleans (menard maranan)Menard Maranan
 
Slides python numbers (menard maranan)
Slides   python numbers (menard maranan)Slides   python numbers (menard maranan)
Slides python numbers (menard maranan)Menard Maranan
 
Python strings Tutorial (menard maranan)
Python strings Tutorial (menard maranan)Python strings Tutorial (menard maranan)
Python strings Tutorial (menard maranan)Menard Maranan
 
Python Learning Journey
Python Learning JourneyPython Learning Journey
Python Learning JourneyMenard Maranan
 

More from Menard Maranan (15)

Python while loops (menard maranan)
Python while loops (menard maranan)Python while loops (menard maranan)
Python while loops (menard maranan)
 
Python if else statements (menard maranan)
Python if else statements (menard maranan)Python if else statements (menard maranan)
Python if else statements (menard maranan)
 
Python tuples (menard maranan)
Python tuples (menard maranan)Python tuples (menard maranan)
Python tuples (menard maranan)
 
Python sets (menard maranan)
Python sets (menard maranan)Python sets (menard maranan)
Python sets (menard maranan)
 
Python dictionaries (menard maranan)
Python dictionaries (menard maranan)Python dictionaries (menard maranan)
Python dictionaries (menard maranan)
 
Python nested lists (menard maranan)
Python nested lists (menard maranan)Python nested lists (menard maranan)
Python nested lists (menard maranan)
 
Python lists (menard maranan)
Python lists (menard maranan)Python lists (menard maranan)
Python lists (menard maranan)
 
Python data structures (menard maranan)
Python data structures (menard maranan)Python data structures (menard maranan)
Python data structures (menard maranan)
 
Python string formatting (menard maranan)
Python string formatting (menard maranan)Python string formatting (menard maranan)
Python string formatting (menard maranan)
 
Python comments (menard maranan)
Python comments (menard maranan)Python comments (menard maranan)
Python comments (menard maranan)
 
Python indexing (menard maranan)
Python indexing (menard maranan)Python indexing (menard maranan)
Python indexing (menard maranan)
 
Slides python booleans (menard maranan)
Slides   python booleans (menard maranan)Slides   python booleans (menard maranan)
Slides python booleans (menard maranan)
 
Slides python numbers (menard maranan)
Slides   python numbers (menard maranan)Slides   python numbers (menard maranan)
Slides python numbers (menard maranan)
 
Python strings Tutorial (menard maranan)
Python strings Tutorial (menard maranan)Python strings Tutorial (menard maranan)
Python strings Tutorial (menard maranan)
 
Python Learning Journey
Python Learning JourneyPython Learning Journey
Python Learning Journey
 

Recently uploaded

WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
WSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million PeopleWSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million PeopleWSO2
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...WSO2
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2
 
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfAzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfryanfarris8
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...WSO2
 

Recently uploaded (20)

WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million PeopleWSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million People
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfAzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
 

Python infographics

  • 1. Strings Numbers Booleans “Hello World” -12 3.14 5+0j True False Menard Maranan -Textual Data -Inside Quotation Marks “ ” -3 Numerical Data -int, float, complex -2 Boolean Values -True and False Menard Maranan https://www.youtube.com/channel/UC28oX1455dR2OF72o1DU80w/
  • 2. What? How? Why? data = [ 2, True] age = 20 print(age) me = “Nard” print( “Hi”, me) Menard Maranan -Stores Data Values -Use Alias for Naming. -Pass Data Values -Call name to Use on code -Shorter Codes -Saves Time Menard Maranan https://www.youtube.com/channel/UC28oX1455dR2OF72o1DU80w/
  • 3. List Dictionary data = [ 1, “Hi”, True ] info = { “Name”: “Menard”, “Age”: 20 } coordinates = ( 12, 98, -23 ) Menard Maranan Menard Maranan https://www.youtube.com/channel/UC28oX1455dR2OF72o1DU80w/ Set numbers = { 9, 2, 4, 2 } Tuple -Inside Brackets [] -Comma Separated -Inside Braces {} -Keyword-Value Pairs -Inside Parenthesis () -Comma Separated -Immutable -Inside Braces {} -Comma Separated -Auto Sort & Unique Values
  • 4. if else while loop for loop sunny = True if sunny: print(“Need Hat”) else: print(“No need”) num = 10 while num != 0: print(num) num -= 1 for x in range(10): print(x) Menard Maranan -Logical Control Flow -Uses Condition/s -Uses Condition/s to loop on a code/s -Uses Iteration to Loop on a code/s Menard Maranan https://www.youtube.com/channel/UC28oX1455dR2OF72o1DU80w/
  • 5. Modes file.read() fileWrt.write() fileApd.write() sound.write() Menard Maranan Menard Maranan https://www.youtube.com/channel/UC28oX1455dR2OF72o1DU80w/ file.close() fileWrt.close() fileApd.close() sound.close() MethodsMethods: file.read() fileWrt.write() open() -Open files through Python Code Characters: ‘r’ read ‘w’ write ‘a’ append ‘b’ binary -Closes the opened File inside Python code close() file = open( “file.txt”, “r”) fileWrt = open( “file.txt”, “w”) fileApd = open( “file.txt”, “a”) sound = open( “sound.mp3”, “b”)
  • 6. except try: answer = 4 / 0 except ZeroDivisionError: print(“INVALID”) else: print(answer) Menard Maranan Menard Maranan https://www.youtube.com/channel/UC28oX1455dR2OF72o1DU80w/ finally: print(“Always Executed”) else -Codes written inside were to be validated if no error/s. -When an error (exception) is raised, codes it hold were executed. -If no error (exception) is raised, codes it hold were executed. -Codes it hold will always be executed regardless if there’s an error or none. try finally
  • 7. What? How? Why? def greet(name): return f‘Hi {name}!’ print(greet(“Menard”)) >>>Hi Menard! print(greet(“Michael”)) print(greet(“Leonel”)) print(greet(“Melanie”)) print(greet(“Leonard”)) Menard Maranan -Takes input (or not), spits output (or not) -Independent from a Class. -Create it & Call it; with or without argument (input); as many times as you want -To Organize Codes. -Saves time from repeated coding. Menard Maranan https://www.youtube.com/channel/UC28oX1455dR2OF72o1DU80w/
  • 8. class method inheritance class Compute(Calculate): def __init__(self, x, y): self.x = x self.y = y print(Compute(9, 2).root()) Menard Maranan -Also called as Objects -A collection of methods -Organizes codes Menard Maranan https://www.youtube.com/channel/UC28oX1455dR2OF72o1DU80w/ -Similar to Functions -Dependent to a Parent Class -Used to pass codes from one class to another class Calculate: def __init__(self, x, y): self.x = x self.y = y def root(self): return pow(self.x, (1 / self.y)) class Calculate: def __init__(self, x, y): self.x = x self.y = y