Python 26 Object Oriented Programming
Skills:
AI Pair Programming60%
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
2
3
4
5
6
7
▶
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Code Commentaries? PHP to JavaScript in Bash and PHP!
John Hammond
Tutorials? MySQL connection with PHP and Bash!
John Hammond
Variable Naming in Python! Happy Birthday, Linux! Nokia N900!
John Hammond
JavaScript Splits The URL!
John Hammond
HTML Tables in Python!
John Hammond
HTML, Net Shares, GML!
John Hammond
Python 08 Programming Style and Comments
John Hammond
Python 26 Object Oriented Programming
John Hammond
75 Python Tutorials, Out Now!
John Hammond
Batch 14 Mathematical Expressions
John Hammond
Batch 85 Array Append
John Hammond
Batch 86 Array Count
John Hammond
Batch 87 Array Index
John Hammond
Batch 88 Array Insert
John Hammond
Batch 89 Array Remove
John Hammond
Batch 90 Array Reverse
John Hammond
Python [colorama] 00 Installing on Linux
John Hammond
Python [colorama] 09 Cursor Position
John Hammond
Python [hashlib] 02 Algorithms
John Hammond
Python 00 Installing IDLE on Linux
John Hammond
Python [pygame] 11 Rectangular Collision Detection
John Hammond
Python [pygame] 12 Platforming Rectangular Collision Resolution
John Hammond
Python [XML-RPC] 01 Research
John Hammond
Python [pyenchant] 03 Personal Word Lists
John Hammond
FancyURLopener Authentication and User-Agent [urllib] 03
John Hammond
Python 04: PEP8 Coding
John Hammond
Python Challenge! 17 COOKIES
John Hammond
Google CTF 2016: Ernst Echidna
John Hammond
Google CTF 2016: Spotted Quoll
John Hammond
Google CTF 2016: Can you Repo It?
John Hammond
Google CTF 2016: No Big Deal
John Hammond
Google CTF 2016: In Recorded Conversation
John Hammond
Homemade CTF Challenge: 01 "Orchestra"
John Hammond
Homemade CTF Challenge: 02 "Bae's Base"
John Hammond
Homemade CTF Challenge: 03 "Web Hunt"
John Hammond
Homemade CTF Challenge: 04 "UPX"
John Hammond
Homemade CTF Challenge: 05 "The Assumption Song"
John Hammond
Homemade CTF Challenge: 06 "A Brisk Stroll"
John Hammond
Homemade CTF Challenge: 06 "I lost my password!"
John Hammond
web25 :: Mr. Robot : EKOPARTY CTF 2016
John Hammond
web50 : RFC 7230 :: EKOPARTY CTF 2016
John Hammond
misc50 : Hidden inside EKO :: EKOPARTY CTF 2016
John Hammond
Hack The Vote 2016 CTF: Sander's Fan Club [web100]
John Hammond
Hack The Vote 2016 CTF Warpspeed [forensics150]
John Hammond
Juniors CTF 2016 :: Black Suprematic Square
John Hammond
Juniors CTF 2016 :: Six Strange Tales
John Hammond
Juniors CTF 2016 :: Lost Code
John Hammond
Juniors CTF 2016 :: Here Goes!
John Hammond
Juniors CTF 2016 :: Southern Cross
John Hammond
Juniors CTF 2016 :: Clone Attack
John Hammond
Juniors CTF 2016 :: Dirty Repo
John Hammond
Juniors CTF 2016 :: Hackers Blog
John Hammond
Juniors CTF 2016 :: Voting!!!
John Hammond
Juniors CTF 2016 :: The Good, The Bad and The Junkman
John Hammond
Juniors CTF 2016 :: Stop Thief!
John Hammond
Juniors CTF 2016 :: ROFL
John Hammond
Juniors CTF 2016 :: Restriced Area
John Hammond
Juniors CTF 2016 :: Oh SSH!
John Hammond
HackCon CTF 2017 TRIVIA and BONUS Challenges
John Hammond
HackCon CTF 2017 "Bacche" Challenges
John Hammond
More on: AI Pair Programming
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
Ethical Hacking Step-by-Step (Part 3)
Medium · Cybersecurity
DORA Compliance in 2026: What European Businesses Actually Need to Know
Medium · Cybersecurity
Apple says it is shipping security updates early as AI speeds up hacking
The Next Web AI
Building a Home SOC Lab from Scratch (Part 1): The Setup
Medium · Cybersecurity
🎓
Tutor Explanation
DeepCamp AI