Python 26 Object Oriented Programming

John Hammond · Intermediate ·🔐 Cybersecurity ·14y ago
If you would like to support me, please like, comment & subscribe, and check me out on Patreon: https://patreon.com/johnhammond010 E-mail: johnhammond010@gmail.com PayPal: http://paypal.me/johnhammond010 GitHub: https://github.com/JohnHammond Site: http://www.johnhammond.org Twitter: https://twitter.com/_johnhammond

What You'll Learn

Explains object-oriented programming concepts in Python

Full Transcript

hey what's going on guys route from know she'll calm here today and we are looking at some more Python now today we're going to be talking about the idea of object-oriented programming object-oriented programming is like a sort of tactic or a mindset or you could even go to lengths to call it a paradigm of the way of writing your code and your programs usually it's kind of denoted as 00 p or at least it's just an acronym for it so you might your programmers developers calling it like that but it's just the idea of using instances or like multiple objects in your programs now you can think of an object like a big machine the big machine can store information it has these properties and these attributes that you can consider to be the variables in our case and they have actions and processes and things that they can do that we can consider to be the message the methods of the functions so now usually you would be using object oriented programming because you have the building access to create multiple instances and instances is a single object because object is kind of the idea or the framework or the blueprint of what you're working with when you have multiple instances like let's say you wanted to have like five enemies if you were if you were programming your video game if you were programming a video game you could have five enemies and all of these enemies are one sort of enemies like if you're making maybe a side-scroller you could just have an enemy that start shooting in one single direction and since you don't have to do this like five times you could just build a framework or a blueprint for this idea in this mindset the this for an instance that will be able to shoot with a function in one direction so you can create five of those just by declaring as many as you need to maybe with a loop or maybe just supplying them different attributes may be a different color may be a different size and that sort of thing so let's open up Idol and let's see what we can do um this might be a little hard to visualize because I'm not going to be showing you in this tutorial the way to make them ourselves unto the way to make objects in the way to create go about object oriented programming ourselves because there's a lot of new keywords after and you just introduced you like class like self constructor that sort of thing but we're going to go into those more in depth in the later tutorials obviously but for now let's take a look at what Python does and the way they store data as objects because that's what they really do they do store data types as objects if we have a string we it's just a new variable and we can just have it be a string so like this is a string now we have strength we can return it and obviously we have this is a string now we get information from our objects with something that we call a dot selector it's just like another operator it's just like another symbol that you've seen before but it's it's simply a dot it's just a period so if we do string dot and we're ready to do things and get things from our object so you can see if you wait a little bit you're going to have your auto completion box just spring up and this is exactly what we wanted to if it doesn't we can just hit control space and there we go now we can look through an idle all the functions and all of the other variables that we would be able to use if we uh let's try something here let's look for count I think that's what I want to look with yet we can use count and now you can see count is a built-in method count of string object and this is the memory address of that object so what we're going to look at here is obviously count is going to be a method or a function so we're going to have to call that and we can it's obviously just a method of that string object and in this case it's string we don't even have to be using this variable though we can just use a completely different set up let's say string is this and obviously that's not set up as anything as a variable but we can still call these things with it because that data type is an object so let's try let's try string dot count now count is a function that will look for a substring or something that is inside that string and it'll display how many of those that it finds so let's say is it should find two of them because it found this the is that's inside this and then the is that's immediately after it so there you go but that's just sort of a really simple idea because you're able to get information you can run functions on inside your objects and that sort of thing but since this is a little bit more abstract because you're just looking at it without visualizing it and making one of your own objects this is the way that I want to introduce it to you though because python stores or objects stores their data as objects we can do so much more let's try an int let's just say integer equals 4 so I wonder if we have any functions we can run at the integer yeah we have all of these and let's see what the integer real so the real form of the integer I'm thinking and yeah if you use the dot selector you can see what you can do with this object but that's all I've got for you in this tutorial we have a lot more to cover there's definitely a lot to talk about in this sort of object oriented programming world it's probably going to become a miniseries just because there's so much out there and so much that I'm able to talk about with you guys but just understand the idea of attributes and properties that you can think of his variables and then the action is the process is that you can think of as functions but hey oh I hope to be seeing you guys in the next tutorial it because you could give me a like maybe a favorite maybe subscribe i don't know that's your doing but i have a great day
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from John Hammond · John Hammond · 8 of 60

1 Code Commentaries? PHP to JavaScript in Bash and PHP!
Code Commentaries? PHP to JavaScript in Bash and PHP!
John Hammond
2 Tutorials? MySQL connection with PHP and Bash!
Tutorials? MySQL connection with PHP and Bash!
John Hammond
3 Variable Naming in Python! Happy Birthday, Linux! Nokia N900!
Variable Naming in Python! Happy Birthday, Linux! Nokia N900!
John Hammond
4 JavaScript Splits The URL!
JavaScript Splits The URL!
John Hammond
5 HTML Tables in Python!
HTML Tables in Python!
John Hammond
6 HTML, Net Shares, GML!
HTML, Net Shares, GML!
John Hammond
7 Python 08 Programming Style and Comments
Python 08 Programming Style and Comments
John Hammond
Python 26 Object Oriented Programming
Python 26 Object Oriented Programming
John Hammond
9 75 Python Tutorials, Out Now!
75 Python Tutorials, Out Now!
John Hammond
10 Batch 14 Mathematical Expressions
Batch 14 Mathematical Expressions
John Hammond
11 Batch 85 Array Append
Batch 85 Array Append
John Hammond
12 Batch 86 Array Count
Batch 86 Array Count
John Hammond
13 Batch 87 Array Index
Batch 87 Array Index
John Hammond
14 Batch 88 Array Insert
Batch 88 Array Insert
John Hammond
15 Batch 89 Array Remove
Batch 89 Array Remove
John Hammond
16 Batch 90 Array Reverse
Batch 90 Array Reverse
John Hammond
17 Python [colorama] 00 Installing on Linux
Python [colorama] 00 Installing on Linux
John Hammond
18 Python [colorama] 09 Cursor Position
Python [colorama] 09 Cursor Position
John Hammond
19 Python [hashlib] 02 Algorithms
Python [hashlib] 02 Algorithms
John Hammond
20 Python 00 Installing IDLE on Linux
Python 00 Installing IDLE on Linux
John Hammond
21 Python [pygame] 11 Rectangular Collision Detection
Python [pygame] 11 Rectangular Collision Detection
John Hammond
22 Python [pygame] 12 Platforming Rectangular Collision Resolution
Python [pygame] 12 Platforming Rectangular Collision Resolution
John Hammond
23 Python [XML-RPC] 01 Research
Python [XML-RPC] 01 Research
John Hammond
24 Python [pyenchant] 03 Personal Word Lists
Python [pyenchant] 03 Personal Word Lists
John Hammond
25 FancyURLopener Authentication and User-Agent [urllib] 03
FancyURLopener Authentication and User-Agent [urllib] 03
John Hammond
26 Python 04: PEP8 Coding
Python 04: PEP8 Coding
John Hammond
27 Python Challenge! 17 COOKIES
Python Challenge! 17 COOKIES
John Hammond
28 Google CTF 2016: Ernst Echidna
Google CTF 2016: Ernst Echidna
John Hammond
29 Google CTF 2016: Spotted Quoll
Google CTF 2016: Spotted Quoll
John Hammond
30 Google CTF 2016: Can you Repo It?
Google CTF 2016: Can you Repo It?
John Hammond
31 Google CTF 2016: No Big Deal
Google CTF 2016: No Big Deal
John Hammond
32 Google CTF 2016: In Recorded Conversation
Google CTF 2016: In Recorded Conversation
John Hammond
33 Homemade CTF Challenge: 01 "Orchestra"
Homemade CTF Challenge: 01 "Orchestra"
John Hammond
34 Homemade CTF Challenge: 02 "Bae's Base"
Homemade CTF Challenge: 02 "Bae's Base"
John Hammond
35 Homemade CTF Challenge: 03 "Web Hunt"
Homemade CTF Challenge: 03 "Web Hunt"
John Hammond
36 Homemade CTF Challenge: 04 "UPX"
Homemade CTF Challenge: 04 "UPX"
John Hammond
37 Homemade CTF Challenge: 05 "The Assumption Song"
Homemade CTF Challenge: 05 "The Assumption Song"
John Hammond
38 Homemade CTF Challenge: 06 "A Brisk Stroll"
Homemade CTF Challenge: 06 "A Brisk Stroll"
John Hammond
39 Homemade CTF Challenge: 06 "I lost my password!"
Homemade CTF Challenge: 06 "I lost my password!"
John Hammond
40 web25 :: Mr. Robot : EKOPARTY CTF 2016
web25 :: Mr. Robot : EKOPARTY CTF 2016
John Hammond
41 web50 : RFC 7230 :: EKOPARTY CTF 2016
web50 : RFC 7230 :: EKOPARTY CTF 2016
John Hammond
42 misc50 : Hidden inside EKO :: EKOPARTY CTF 2016
misc50 : Hidden inside EKO :: EKOPARTY CTF 2016
John Hammond
43 Hack The Vote 2016 CTF: Sander's Fan Club [web100]
Hack The Vote 2016 CTF: Sander's Fan Club [web100]
John Hammond
44 Hack The Vote 2016 CTF Warpspeed [forensics150]
Hack The Vote 2016 CTF Warpspeed [forensics150]
John Hammond
45 Juniors CTF 2016 :: Black Suprematic Square
Juniors CTF 2016 :: Black Suprematic Square
John Hammond
46 Juniors CTF 2016 :: Six Strange Tales
Juniors CTF 2016 :: Six Strange Tales
John Hammond
47 Juniors CTF 2016 :: Lost Code
Juniors CTF 2016 :: Lost Code
John Hammond
48 Juniors CTF 2016 :: Here Goes!
Juniors CTF 2016 :: Here Goes!
John Hammond
49 Juniors CTF 2016 :: Southern Cross
Juniors CTF 2016 :: Southern Cross
John Hammond
50 Juniors CTF 2016 :: Clone Attack
Juniors CTF 2016 :: Clone Attack
John Hammond
51 Juniors CTF 2016 :: Dirty Repo
Juniors CTF 2016 :: Dirty Repo
John Hammond
52 Juniors CTF 2016 :: Hackers Blog
Juniors CTF 2016 :: Hackers Blog
John Hammond
53 Juniors CTF 2016 :: Voting!!!
Juniors CTF 2016 :: Voting!!!
John Hammond
54 Juniors CTF 2016 :: The Good, The Bad and The Junkman
Juniors CTF 2016 :: The Good, The Bad and The Junkman
John Hammond
55 Juniors CTF 2016 :: Stop Thief!
Juniors CTF 2016 :: Stop Thief!
John Hammond
56 Juniors CTF 2016 :: ROFL
Juniors CTF 2016 :: ROFL
John Hammond
57 Juniors CTF 2016 :: Restriced Area
Juniors CTF 2016 :: Restriced Area
John Hammond
58 Juniors CTF 2016 :: Oh SSH!
Juniors CTF 2016 :: Oh SSH!
John Hammond
59 HackCon CTF 2017 TRIVIA and BONUS Challenges
HackCon CTF 2017 TRIVIA and BONUS Challenges
John Hammond
60 HackCon CTF 2017 "Bacche" Challenges
HackCon CTF 2017 "Bacche" Challenges
John Hammond

Related AI Lessons

Ethical Hacking Step-by-Step (Part 3)
Learn ethical hacking by understanding network security fundamentals, including packets, firewalls, and traffic analysis using Wireshark.
Medium · Cybersecurity
DORA Compliance in 2026: What European Businesses Actually Need to Know
European businesses using cloud infrastructure must understand DORA compliance in 2026 to avoid regulatory risks
Medium · Cybersecurity
Apple says it is shipping security updates early as AI speeds up hacking
Apple now ships security updates early due to AI speeding up hacking, learn how to prioritize security in your development cycle
The Next Web AI
Building a Home SOC Lab from Scratch (Part 1): The Setup
Learn to build a home SOC lab from scratch using Splunk, Sysmon, and VMs to improve detection skills
Medium · Cybersecurity
Up next
You Think Your Card Declined by Mistake? It Might Be a 2026 Scam
Tolulope Michael
Watch →