Hey Tim, author of Practices of the Python Pro here! Thanks so much for distilling a number of concepts in the book to these tangible examples. Reading about them is one thing, but watching code change in real time often helps folks really see the value. Well done as always, and thanks for the shout out!
You making videos for people who have done the circuit of "beginner tutorials" is a godsend. I can make the loops, I understand the syntax but I really think it's so nice to see what it is I need to do to get a bigger picture. Thank you for making these, I'm definitely following
Finally I've found someone who can teach, without getting sidetracked or losing my attention by just going to slow. It's so much easier to follow along when you keep the momentum going. Keep up the good work!
0:00 Introduction 2:19 Why software design is important :flexibility&scalability (if the input or problem is changed) 8:30 use the code multiple times and change it in the future: split the code in classes/methods/function +more make readable and debug-able 18:26 make modules( separate files) to be cohesive, import functions from other modules 28:00 packages 33:00 conclusion
I'm an Italian computer science student and I swear that it doesn't matter if I know topics you're talking about, I'll watch your videos 'cause I'm just amazed about the way you explain concepts. Keep up the great work Tim, you're a programming beast! 💪🏽
I haven't seen the whole video, and I'm not a Python developer. However, one improvement you can do with your guessing game is to separate your UI from your guessing game logic. If I'm not mistaken, input and print are console operations. As of right now, your guessing game is coupled to a console app. If you separate the UI and put the logic in its own module, you can reuse it for other apps such as desktop, console, and web. Anyway, great content!
The guess game class was like a poet! Beautiful and full of meaning! I'm not a very good programmer, but as I move forward and learn more I appreciate the beauty of good code more and more.
Hey I think it's time i introduce myself: My name is Victor and I'm sixteen Since I was thirteen I have been learning python from you although not full-time but your tutorial s have taken me a long way and I want to take on computer science in a year. Thank you Tim you r my role model
It's awesome you're getting into computer science at such a young age. Once you learn one language it only gets easier. Basically all programming languages reuse the same concepts, just different syntax and implementation. You'll do great. Good luck.
So far this has to be the best channel I've found for learning to code. I'm extremely new to this but having watched a handful of your earlier videos I've been able to keep up with your explanations. I can't write code like this but I understand the concept. I find it's a rarity these days to be able to watch an entire video from someone on UA-cam.. You have a talent for keeping the content engaging and moving at a pace that's just right!
WoW your tutorials are like fast reading a 200 page book. In start it was hard for me to follow what you are saying but now that I am an intermediate programmer and doing Data Analysis using Python and SQL. I can quickly grasp what you are saying. You kind of reminds of Sheldon Cooper from TV Series Big Bang Theory.
Damn this channel is superb! I never thought to find something this good for free! I found this channel by chance, actually youtube algorithms showed it to me and I feel like someone who found a gold coin in the street!
This is a GREAT video and it was posted just at the perfect timing! I´ve been looking for guides that could teach me how to arrange the codes better for several days. I´ve read books and watched videos in three different languages but still couldn´t find the best answer. Then I found this excellent tutorial, thank you very much, since it really helps me a lot! Furthermore, I´m really hoping to see you explaining the execution order of python codes. I´m having difficulties to arrange them when I have to introduce classes, define functions and instantiate a window with multiples widgets for my simple GUI at the same time. I don´t know which part should come first and which next. I would appreciate that, if somebody can recommend some chapters from books or some videos to me!
18:51 I found that to be especially important in programming! Would it be possible for you to make a video about it maybe? For example, I suck at doing flowcharts and it'd be nice to see what an optimal approach would look like!
15:21 there is even a better way (i think) of doing it: import random import time class Game: def __init__ (self, min, max, times=0): self.min = min self.max = max self.times = times def startnum(self): global correct global pas pas = True correct = random.randrange(self.min, self.max) global guess guess = int(input(f"Guess Numbers between {self.min} - {self.max}: ")) if guess > self.max or guess < self.min: print('Wrong Range, reset') pas = False else: pas = True return guess, correct def is_Correct(self): if pas == True: if correct == guess: return f'You have won, the correct number is {correct}' else: return f'You have lost, the correct number is {correct}' else: self.startnum() def play(self): self.startnum() time.sleep(0.6) print(self.is_Correct()) print(correct) game = Game(1, 2) game.startnum() print(game.is_Correct())
Really out of all python channels out there you are the best!!! I really like your explanation style. if you get it you can go at 1.5x or something and you can get it or if you don't get it go at normal speed and even then understand it. Thanks for the tutorials!!!
Nice video brother, I want to share with you my thoughts about this. Code reuse: 1- Since the purpose of using the GuessNumber class is just code reuse, it is better to implement the valid_number and get_guess methods independently from the class as separate functions, that way you could use them for prompting the user to input a number in a given range outside the context of the guessing game; and you won't sacrifice the class functionality. When you import the class in another program, you don't need to import the stand-alone functions with it because python will automatically encapsulate the dependencies of the play method implicitly within the imported class. 2- Instead of implementing the guesses variable as an attribute, making it local to the play method makes the game object replayable without the need to reconstruct another object with the same parameters. 3- It is a good idea to not force specifying the number at the construction of the object, instead, provide the option of setting it later when calling the play method. In other words, the game object could be constructed only specifying the range bounds. If the number is fixed at the instantiation, any value given at the play method will be ignored. 4- Another good idea is to implement random number generation in the class by giving the option for a game object to have no fixed number at all. Meaning that when you do not specify the number in the class constructor, nor in the play method, the game chooses a random number in the range by itself. Simplification: 1- There is no need to name a variable if you are going to use it once. You can still execute .play() from the game object without assigning it to a variable, and that is one line of code. 2- By renaming the method play to __call__, you get rid of the .play thing. And you call the game object directly. Performance: Since my programming skills are built more about performance than code reuse and readability, when I see a function executed twice on the same input, my brain hurts. My programming reflexes tell me to capture the output for the second use. While performance is not a real issue in this example, the conversion to int happening twice on the same string still makes me uncomfortable. And the code becomes like this: from random import randint def convert_valid(str_number,mn,mx): try: number = int(str_number) except: return if number in range(mn,mx+1): return number def get_guess(mn,mx): guess = convert_valid(input(f"please guess ({mn}-{mx}):"),mn,mx) if guess != None: return guess print("please enter a valid number") return get_guess(mn,mx) class GuessNumber: __slots__="min","max","number" def __init__(self,mn=0,mx=100,number=None): if number != None: assert mn
You are specially good. Beside presenting high quality content, introducing us to resources and books is a very good thing. Most of youtubers don't do this.
Thanks for taking the time to make tutorials like this! I'd love to see more like this - there's so many tutorials on what you "can" do in Python but so few like this on good practices and organization.
Thank you! I love all that is related to design, I've been reading the "Head first design and oop" book and your video is really helpful to see all that stuff implemented!
Another thing I feel should be mentioned with example 2 versus example 1, at 16:47, is that the class in example2 can be easily out sourced to another file, making troubleshooting easier, and you code overall cleaner and easier to read.
Really useful info for organising code in a professional way, I need to rethink all my software robotics projects, your tutorial helps me a lot, hope in future you will continue this subject about smart software design and organising
18:00 I have found that it's usually also better to reduce the play() method to something simple like while not self.game_over: self.play_round() because if you want to make a subclass then you can easily extend the play_round() method, but you can't extend a method that contains the main loop
Hi Tim. Thanks for this awesome video. Very helpful to get a broader perspective on what clean code looks like and how it functions. I also found it very helpful to start with poorly written code and how to transform poor code into clean code. 🙂
Thanks Tim, this video is exactly what I needed in my current learning process. Feel free to make more of those in the future it is just awesome! Keep up the good work!!! Cheers
I got into programming C++ awhile back, glad I made the switch to Python, I can get so much more done with fewer lines of code. One of my for fun side projects is a text based adventure game, kind of like ZORK. In the game, there is a combat system. I did not know how to "randomize" the chances of a successful hit, so I had to have the player open an online dice simulator, to represent random chance. Python has randint and that makes it so much easier to code my text games.
You could've used the built in eand function in cpp, instead you changed languages and chose a language that needs a separated library to generate random integral numbers.
I am a selftaught programmer and I am realising that I learned these things passively while watching other people's code and by learning 90 ways of writing Effective Python Code. So basically I learned how to design Softwares. Cool.
Very good Tim, a follow on that I would like to see would cover data structures. Coming from C, I miss when working in Python, Of course dict, list, tuple, string etc are understandable each on their own, but I do struggle a bit on organizing at the appropriate level. I am learning of course but a lecture which joins concepts from C --> Python would help me. Thanks
i think there is a problem at 14:49 the last print must be inside the while loop right ? whether we put over or under number we will get printed that last print .
At 30:36 we have import util. In that case, we can only use the code from the __init__.py file. To use the code from modules ht_functions and list_functions, we have to import them additionally. Is it correct? Thanks...
I don't know if you still reply to questions, but in the example code at 13:00 would it be better to use a while loop instead of using recursion for get_guess()? Because with recursion you can break the program if you exceed the maximum depth.
Excellent video Tim, thank you. quick suggestion,you can make this a series where you can explain how some software design principles are necessary to follow for specific use cases.Like making rest APIs that are secure etc. I would love to learn more from you .
One disadvantage of using python is, it's slow, do you know a way to boost python performance in general?. I heard Cython is a great solution for that, did you plan to release this kind of tutorial? since we tend to lean toward python programming
It depends on what task you're trying to accomplish. For example, you can look up an idea called Vectorization for speeding up certain data manipulation tasks. For most tasks outside of data manipulation, such as general application development, the amount of intensive computation you have to do is generally really small, so the speed advantages of other platforms aren't noticeable. The biggest exception is game development, where game states aren't vectorizable and performance is required. That's why big AAA games aren't written in python.
God I wish I had come across this before submitting a technical interview project last week. Basically told me it needed to be more like what you're showing here. (I sent them a Notebook). It's so true that many python tutorials or hobby books (Manning and NoStarch are my go to's) don't emphasise well structured projects for sharing. More so end up as scripts that do neat things and demonstrate the libraries well, but don't encourage good, employable practices. If you're a self taught programmer (like me) this is where you can have blind spots and get slammed
Thanks Tim, very nice video :) it’s very useful as we move from beginner to intermediate level in python programming. I would love if you made a video about ‘the pythonic’ way of programming in Python. I read this around a lot, and I have a basic understanding of what it means, but I am sure you could provide more insight on how to be more ‘pythonic’.
Is the best video and Explanation on youtube I have watched uptill now. Wonderful Tim. You are really great teacher. Do you offer some courses on Machine Learning, Numpy and Pandas?
18:50 you might have even gone a little further with your "Example 2 e2". What I actually do not like people to do is having more than one call to return within one function. Or short rule: one function one return. o actaully if I had a trainee here that wants to learn coding I would be in search of a vide covering that as well.
Thanks Tim for the video! I have a question: Why did you choose to separate the list_functions and hash_functions into 2 separate modules instead of 2 classes in one module? In the heriarchy 32:33 (package --> modules --> classes --> methods --> functions) how does one choose how to organize their code beforehand? Do you just refactor as you go along?
The way I understood it, he did it to future-proof the modules. If each of those classes got longer and longer by adding more functions, it would result in one big monster module. Splitting them into 2, leaves more room for each to grow before becoming too big to manage
I do not like to work with classes, for me it is more "complicated" with all those "self" I prefere work with modules.py and add the functions that makes sense for that particular module, just ike you showed here 21:00 then I create a main file that call all those functions. For me is the easiest way to organize my codes. I work with process authomation, maybe I would prefere Classes if I worked with games bcs of the inherit thing And I use to do it not only in python but in vba as well.
Alex, I get where you are coming from, however I challenge you to push thru to class. I think the key is to understand that with 'class' you are creating your own data/methods type and then when using the class you "instantiate", or make a item of instance type the_class_name you have chosen. The 'self' thing was a mystery and source of confusion to me also. But when you see the connection a little light will go on in your mind and you will get it, and see how it works. The word 'self' refers to the instance or copy you, 'will', create when you instantiate. So say you have a class by the name 'animal'. Inside the class you may find a variable called self.skin_color. Then you may use it to make several animals like pig = animal(pink) and cow = animal(brown). Each animal, (pig or cow) is a separate 'instance' of animal, each with its own attribute color,... Hope that helps.
it will be a good idea to make a complete tutorial of software developing with python, I think we should pass from the beginning level to the advanced, by making some real and complete project .
Hey Tim, author of Practices of the Python Pro here!
Thanks so much for distilling a number of concepts in the book to these tangible examples. Reading about them is one thing, but watching code change in real time often helps folks really see the value.
Well done as always, and thanks for the shout out!
Hey Dane! No problem, looking forward to diving deeper into the book. Has been a great read so far :)
Sorry, check the IBM Documentation on Software Application Architecture
Pretty old and independ of any language. Still the standard of the trade.
@@MBrieger Do you have a link to that Book/ Document?
@@MrKurdishFreak www.amazon.com.au/Practices-Python-Pro-Dane-Hillard/dp/1617296082/ref=sr_1_1?keywords=Practices+of+the+Python+Pro&qid=1589844408&sr=8-1
Hey Dane, no kindle version on amazon, is that weird?
You making videos for people who have done the circuit of "beginner tutorials" is a godsend. I can make the loops, I understand the syntax but I really think it's so nice to see what it is I need to do to get a bigger picture. Thank you for making these, I'm definitely following
I second that!
so true!
I like this dude
he helps you get out of tutorial hell
Finally I've found someone who can teach, without getting sidetracked or losing my attention by just going to slow. It's so much easier to follow along when you keep the momentum going. Keep up the good work!
0:00 Introduction
2:19 Why software design is important :flexibility&scalability (if the input or problem is changed)
8:30 use the code multiple times and change it in the future: split the code in classes/methods/function +more make readable and debug-able
18:26 make modules( separate files) to be cohesive, import functions from other modules
28:00 packages
33:00 conclusion
I'm an Italian computer science student and I swear that it doesn't matter if I know topics you're talking about, I'll watch your videos 'cause I'm just amazed about the way you explain concepts. Keep up the great work Tim, you're a programming beast! 💪🏽
I haven't seen the whole video, and I'm not a Python developer. However, one improvement you can do with your guessing game is to separate your UI from your guessing game logic. If I'm not mistaken, input and print are console operations. As of right now, your guessing game is coupled to a console app. If you separate the UI and put the logic in its own module, you can reuse it for other apps such as desktop, console, and web. Anyway, great content!
Your examples are so helpful, they really help me realizing in which cases that could be used. Thanks a lot for your work and stay safe
The guess game class was like a poet! Beautiful and full of meaning! I'm not a very good programmer, but as I move forward and learn more I appreciate the beauty of good code more and more.
You've said in the first minute everything with what I'm struggle with
Thanks for your time to make such great educational videos!
Hey I think it's time i introduce myself:
My name is Victor and I'm sixteen
Since I was thirteen I have been learning python from you although not full-time but your tutorial s have taken me a long way and
I want to take on computer science in a year. Thank you Tim you r my role model
It's awesome you're getting into computer science at such a young age. Once you learn one language it only gets easier. Basically all programming languages reuse the same concepts, just different syntax and implementation. You'll do great. Good luck.
So far this has to be the best channel I've found for learning to code. I'm extremely new to this but having watched a handful of your earlier videos I've been able to keep up with your explanations. I can't write code like this but I understand the concept.
I find it's a rarity these days to be able to watch an entire video from someone on UA-cam.. You have a talent for keeping the content engaging and moving at a pace that's just right!
young buck is the best OOP teacher I've seen period
agree!
The idea of a package have never really been explained this good before.
WoW your tutorials are like fast reading a 200 page book. In start it was hard for me to follow what you are saying but now that I am an intermediate programmer and doing Data Analysis using Python and SQL. I can quickly grasp what you are saying. You kind of reminds of Sheldon Cooper from TV Series Big Bang Theory.
you’re killing it Tim hope your career is taking off
Damn this channel is superb! I never thought to find something this good for free! I found this channel by chance, actually youtube algorithms showed it to me and I feel like someone who found a gold coin in the street!
i have 59 and my prof have 19 year old. Thank you for this experience...
CodyLLC I’m assuming English isn’t the first language here. Some languages say they have certain ages instead of is a certain age.
He said that his teacher (Tim) is 19 years old while he is 59.
Deep
@@The4lexO yeh
What...?
This is a GREAT video and it was posted just at the perfect timing!
I´ve been looking for guides that could teach me how to arrange the codes better for several days. I´ve read books and watched videos in three different languages but still couldn´t find the best answer. Then I found this excellent tutorial, thank you very much, since it really helps me a lot!
Furthermore, I´m really hoping to see you explaining the execution order of python codes. I´m having difficulties to arrange them when I have to introduce classes, define functions and instantiate a window with multiples widgets for my simple GUI at the same time. I don´t know which part should come first and which next. I would appreciate that, if somebody can recommend some chapters from books or some videos to me!
ordering: imports, constants, classes, functions, mainline
@@TechWithTim Thanks!
18:51 I found that to be especially important in programming! Would it be possible for you to make a video about it maybe? For example, I suck at doing flowcharts and it'd be nice to see what an optimal approach would look like!
15:21 there is even a better way (i think) of doing it:
import random
import time
class Game:
def __init__ (self, min, max, times=0):
self.min = min
self.max = max
self.times = times
def startnum(self):
global correct
global pas
pas = True
correct = random.randrange(self.min, self.max)
global guess
guess = int(input(f"Guess Numbers between {self.min} - {self.max}: "))
if guess > self.max or guess < self.min:
print('Wrong Range, reset')
pas = False
else:
pas = True
return guess, correct
def is_Correct(self):
if pas == True:
if correct == guess:
return f'You have won, the correct number is {correct}'
else:
return f'You have lost, the correct number is {correct}'
else:
self.startnum()
def play(self):
self.startnum()
time.sleep(0.6)
print(self.is_Correct())
print(correct)
game = Game(1, 2)
game.startnum()
print(game.is_Correct())
Lmao, this hurts to read, but you've likely made progress since then. Why did this get upvoted?
Wow
Extreme compression
@@duddie4171 I mean, the init function has single underscores, he didn't understand anything from the video lol
Big thank again. Now every time when i needed to learn a new thing about Python, I look for lessons made my Tim only.........
Now i have a higher sight of programming. Thanks you so much
Hi, I really love your videos. I am 15. Your python tutorials are amazing. You are my inspiration for my youtube channel
great, very unique video for intermediate python developer..want more this type of videos
Thanks man thats what I was looking for. Your tutorials are easy to understand.
This is EXACTLY the point I am right now.
Thank for the video!!!
Really out of all python channels out there you are the best!!! I really like your explanation style. if you get it you can go at 1.5x or something and you can get it or if you don't get it go at normal speed and even then understand it. Thanks for the tutorials!!!
This video is the perfect leg-up from basics. Tha is fir making this, Tim! I'll be checking out everything in this series!
You are so good in what you do! Keep it up man, this really helps
Nice video brother, I want to share with you my thoughts about this.
Code reuse:
1- Since the purpose of using the GuessNumber class is just code reuse, it is better to implement the valid_number and get_guess methods independently from the class as separate functions, that way you could use them for prompting the user to input a number in a given range outside the context of the guessing game; and you won't sacrifice the class functionality. When you import the class in another program, you don't need to import the stand-alone functions with it because python will automatically encapsulate the dependencies of the play method implicitly within the imported class.
2- Instead of implementing the guesses variable as an attribute, making it local to the play method makes the game object replayable without the need to reconstruct another object with the same parameters.
3- It is a good idea to not force specifying the number at the construction of the object, instead, provide the option of setting it later when calling the play method. In other words, the game object could be constructed only specifying the range bounds. If the number is fixed at the instantiation, any value given at the play method will be ignored.
4- Another good idea is to implement random number generation in the class by giving the option for a game object to have no fixed number at all. Meaning that when you do not specify the number in the class constructor, nor in the play method, the game chooses a random number in the range by itself.
Simplification:
1- There is no need to name a variable if you are going to use it once. You can still execute .play() from the game object without assigning it to a variable, and that is one line of code.
2- By renaming the method play to __call__, you get rid of the .play thing. And you call the game object directly.
Performance:
Since my programming skills are built more about performance than code reuse and readability, when I see a function executed twice on the same input, my brain hurts. My programming reflexes tell me to capture the output for the second use. While performance is not a real issue in this example, the conversion to int happening twice on the same string still makes me uncomfortable.
And the code becomes like this:
from random import randint
def convert_valid(str_number,mn,mx):
try: number = int(str_number)
except: return
if number in range(mn,mx+1): return number
def get_guess(mn,mx):
guess = convert_valid(input(f"please guess ({mn}-{mx}):"),mn,mx)
if guess != None: return guess
print("please enter a valid number")
return get_guess(mn,mx)
class GuessNumber:
__slots__="min","max","number"
def __init__(self,mn=0,mx=100,number=None):
if number != None: assert mn
This is the first time I am learning Python and it is really helpful
You are specially good. Beside presenting high quality content, introducing us to resources and books is a very good thing. Most of youtubers don't do this.
Thanks for taking the time to make tutorials like this! I'd love to see more like this - there's so many tutorials on what you "can" do in Python but so few like this on good practices and organization.
Bro, I hit the like button 2 seconds in every time, I just know I'm gonna learn something here. Thanks Tim
Bro, you sound like an ad bot. ;-)
@@lepidoptera9337 Maybe, but I like the channel.
@@anthonyrojas9989 Don't sound like an ad bot, not even if you like the channel. ;-)
@@lepidoptera9337 Wtf do you care what I'm saying?
Dude. This couldn't have come at a better time. Thanks Tim
This is exactly the video I needed to watch tonight. Lots of great information here. Thank you!
19:35. Just a suggestion... double triple quotes are generally used for docstrings, if you want to comment your python code you should use #
4th. I always watch your videos. They're so good!
Very nice. Thank you, sir. Clear, concise and useful information.
Thanks Tim. I found it helpful. I love the way you explained in details
Thank you for this. Principle of change and avoiding hard coding explained really well. So helpful.
Dear Tim, we really appreciate the content you created for us...you really help us a lot and we appreciate that....thank you very much again!!!
Im improving my English and my programming skills with you. Thanks.
Thank you! I love all that is related to design, I've been reading the "Head first design and oop" book and your video is really helpful to see all that stuff implemented!
Another thing I feel should be mentioned with example 2 versus example 1, at 16:47, is that the class in example2 can be easily out sourced to another file, making troubleshooting easier, and you code overall cleaner and easier to read.
I've already jumped into the database section but never have I organized my code.. Thank you for this Tim!
Really useful info for organising code in a professional way, I need to rethink all my software robotics projects, your tutorial helps me a lot, hope in future you will continue this subject about smart software design and organising
This video is exciting to watch. It seems to be out of world.
4:35 in valid_num method , what type of return is that? A boolean? or int? because in return statement it has
Great video, some of the best explanations of great practice in half an hour.
You Set The UA-cam On Fire With This Helpful Video.
Seeing the first example and thinking “you can use .join()” before Tim explains really makes me
feel like I’m getting better :D
18:00 I have found that it's usually also better to reduce the play() method to something simple like
while not self.game_over:
self.play_round()
because if you want to make a subclass then you can easily extend the play_round() method, but you can't extend a method that contains the main loop
Wouldn't that be recursive?
Man.. this is gold!! More videos on this topic please!!
Hi Tim. Thanks for this awesome video. Very helpful to get a broader perspective on what clean code looks like and how it functions. I also found it very helpful to start with poorly written code and how to transform poor code into clean code. 🙂
Great timing. We needed this during the lockdown.
Thanks.
I am relatively new to Python and this information was really useful
Thanks Tim, this video is exactly what I needed in my current learning process. Feel free to make more of those in the future it is just awesome! Keep up the good work!!! Cheers
I got into programming C++ awhile back, glad I made the switch to Python, I can get so much more done with fewer lines of code. One of my for fun side projects is a text based adventure game, kind of like ZORK. In the game, there is a combat system. I did not know how to "randomize" the chances of a successful hit, so I had to have the player open an online dice simulator, to represent random chance. Python has randint and that makes it so much easier to code my text games.
You could've used the built in eand function in cpp, instead you changed languages and chose a language that needs a separated library to generate random integral numbers.
GuessNumber is a "HelloWorld" of introduction to layered (Clean) architecture.
I am a selftaught programmer and I am realising that I learned these things passively while watching other people's code and by learning 90 ways of writing Effective Python Code. So basically I learned how to design Softwares. Cool.
LMAO
Thank you. This video helped me under stand this issue better.
Really useful information. Keep up the good work!!!
Your latest videos have great content!! Congratulations sir! Thank you very much!!
Very good Tim, a follow on that I would like to see would cover data structures.
Coming from C, I miss when working in Python,
Of course dict, list, tuple, string etc are understandable each on their own,
but I do struggle a bit on organizing at the appropriate level.
I am learning of course but a lecture which joins concepts from C --> Python would help me.
Thanks
Very clear example of Classes, OOP.
awesome and on point. Exactly what I was looking for
i think there is a problem at 14:49 the last print must be inside the while loop right ? whether we put over or under number we will get printed that last print .
One of the best things in the internet
At 30:36 we have import util. In that case, we can only use the code from the __init__.py file. To use the code from modules ht_functions and list_functions, we have to import them additionally. Is it correct? Thanks...
Thank you, Tim, for a great video and explanation. it was superb.
good advice as always. love the perfect flow of the video, you planned it really well!
Super helpful on "where to go next"
I don't know if you still reply to questions, but in the example code at 13:00 would it be better to use a while loop instead of using recursion for get_guess()?
Because with recursion you can break the program if you exceed the maximum depth.
Excellent video Tim, thank you.
quick suggestion,you can make this a series where you can explain how some software design principles are necessary to follow for specific use cases.Like making rest APIs that are secure etc. I would love to learn more from you .
One disadvantage of using python is, it's slow, do you know a way to boost python performance in general?. I heard Cython is a great solution for that, did you plan to release this kind of tutorial? since we tend to lean toward python programming
Ya . . . We all need it
Python being slow is not that big of an issue. If you write efficient algorithms the time difference won’t be noticeable.
It depends on what task you're trying to accomplish. For example, you can look up an idea called Vectorization for speeding up certain data manipulation tasks.
For most tasks outside of data manipulation, such as general application development, the amount of intensive computation you have to do is generally really small, so the speed advantages of other platforms aren't noticeable. The biggest exception is game development, where game states aren't vectorizable and performance is required. That's why big AAA games aren't written in python.
God I wish I had come across this before submitting a technical interview project last week. Basically told me it needed to be more like what you're showing here. (I sent them a Notebook).
It's so true that many python tutorials or hobby books (Manning and NoStarch are my go to's) don't emphasise well structured projects for sharing. More so end up as scripts that do neat things and demonstrate the libraries well, but don't encourage good, employable practices. If you're a self taught programmer (like me) this is where you can have blind spots and get slammed
Very clearly put across. Great job. 👍
excellent tutorial, thanks for your contribution
Thankyou for providing us valueable content ♥️
DAMN Just awesome... keep it up dude.
Awesome video. Don't forget the Analysis, Testing, Documenting, Evaluation and Maintenance phases ;)
Love it Tim. Thank you.
thank you tim, this is really worth it
Great video, Tim. I appreciate it! :)
Excellent video! Thanks so much
Thanks Tim, very nice video :) it’s very useful as we move from beginner to intermediate level in python programming. I would love if you made a video about ‘the pythonic’ way of programming in Python. I read this around a lot, and I have a basic understanding of what it means, but I am sure you could provide more insight on how to be more ‘pythonic’.
Very good, thanks for making it.
love it and thank you for this man , and love all your videos
Thanks For Making this Helpful Video.
Is the best video and Explanation on youtube I have watched uptill now. Wonderful Tim. You are really great teacher. Do you offer some courses on Machine Learning, Numpy and Pandas?
loved this vid, great info! would like more level 2 tutorials!
18:50 you might have even gone a little further with your "Example 2 e2". What I actually do not like people to do is having more than one call to return within one function. Or short rule: one function one return. o actaully if I had a trainee here that wants to learn coding I would be in search of a vide covering that as well.
A brilliant video. Thanks a lot.
Thanks Tim for the video! I have a question: Why did you choose to separate the list_functions and hash_functions into 2 separate modules instead of 2 classes in one module? In the heriarchy 32:33 (package --> modules --> classes --> methods --> functions) how does one choose how to organize their code beforehand? Do you just refactor as you go along?
The way I understood it, he did it to future-proof the modules. If each of those classes got longer and longer by adding more functions, it would result in one big monster module. Splitting them into 2, leaves more room for each to grow before becoming too big to manage
Great Content Tim,
I'll be waiting more of this series!
this was very useful, thanks tim
75% speed -> "ah now I can keep up" damn
I do not like to work with classes, for me it is more "complicated" with all those "self" I prefere work with modules.py and add the functions that makes sense for that particular module, just ike you showed here 21:00 then I create a main file that call all those functions. For me is the easiest way to organize my codes. I work with process authomation, maybe I would prefere Classes if I worked with games bcs of the inherit thing
And I use to do it not only in python but in vba as well.
Alex, I get where you are coming from, however I challenge you to push thru to class. I think the key is to understand that with 'class' you are creating your own
data/methods type and then when using the class you "instantiate", or make a item of instance type the_class_name you have chosen. The 'self' thing was a mystery and source of confusion to me also. But when you see the connection a little light will go on in your mind and you will get it, and see how it works.
The word 'self' refers to the instance or copy you, 'will', create when you instantiate. So say you have a class by the name 'animal'. Inside the class you may find a variable called self.skin_color. Then you may use it to make several animals like pig = animal(pink) and cow = animal(brown). Each animal, (pig or cow) is a separate 'instance' of animal, each with its own attribute color,... Hope that helps.
it will be a good idea to make a complete tutorial of software developing with python, I think we should pass from the beginning level to the advanced, by making some real and complete project .