Python for Absolute Beginners Transcripts
Chapter: Course conclusion
Lecture: Review: Problem solving
0:00 Next thing we discussed
0:01 were some techniques for problem solving.
0:03 Remember it's very challenging
0:04 when you sit down at just a blank screen
0:07 to start writing code.
0:08 Because it's there's so many ways you can go.
0:11 So many ways you can solve it.
0:12 And if you don't break it down in the right way
0:14 it's actually kind of challenging.
0:16 We talked about these different ways
0:18 and these techniques that you can use.
0:19 One was, have I seen a similar problem solved before?
0:24 And which way is this similar?
0:25 And can I use the same solution for that part of it?
0:27 Visualizing the data helps you understand
0:30 what you're working with.
0:31 Leads ahead to thinking about what data structures
0:33 or how you're going to store and pass it around.
0:36 Divide and conquer is a huge part of this.
0:38 We did this with all our games, and our algorithms.
0:41 We sketched out like these are the four or five things
0:43 we got to do to make this work.
0:45 And then you don't have one big problem
0:46 you have five small problems.
0:48 And that's much easier to solve.
0:50 Run through the data structures.
0:51 We saw that switching from some giant
0:53 if else if else nested if else statement
0:57 to just a dictionary turned out to be super powerful.
1:01 And even made our code more flexible.
1:03 It was more readable, more maintainable
1:04 and it had other benefits that we maybe didn't see coming.
1:08 Is there an existing pypi package.
1:11 Meaning, you were thinking about solving some problem.
1:14 Instead of writing all the code to do it
1:15 is there something basically out there?
1:17 There 215,000 packages over at pypi.org.
1:21 Chances are, a lot of the challenges you're facing
1:24 can be a couple of function calls against those libraries
1:26 that you don't have to work on.
1:28 That's the best way to do it if you can.
1:30 Remember, struggling with working through these problems
1:32 that's part of the journey.
1:34 That's also part of the payoff.
1:35 So when you get it right and when you finish that program
1:38 and you get it working
1:39 the joy is overcoming all these steps.
1:41 So this is just part of the journey
1:42 and embrace it.
1:44 And don't suffer from analysis paralysis, just start.
1:48 We have cool refactoring tools built into our software.
1:51 The software's easy to change
1:53 and you honestly won't know all the details
1:55 that you need to think about
1:56 until you're part way through solving the problem.
1:59 A lot of times the best thing to do
2:00 is quickly run through the stuff
2:02 and just get started and change it as you learn more.