Does anyone have a good way of learning how to build your own algorithm in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Does anyone have a good way of learning how to build your own algorithm in python?

I've been having issues putting together some sort of algorithm for any issue I'm trying to compute an answer for in python? So I was wondering if anyone has any suggestions on how to get better faster? And how to improve their critical thinking during coding?

14th Jun 2017, 12:22 AM
Ava Nicole
Ava Nicole - avatar
13 Answers
+ 2
This is in fact not specific to python :) . With every programming language you need to be able to convert your specific problem into a form that can be solved by a computer - and that is before you write even your first line of code. Unfortunately, there are no shortcuts for this. But practice helps - the more you work on this, and the more you see various algorithms being used in practice (a course or a book on algorithms really helps here), the more you will start to see patterns. And you will start to think "oh, this problem I'm having looks like a place where I can use algorithm X" :)
14th Jun 2017, 7:36 AM
Bogdan Sass
Bogdan Sass - avatar
+ 4
Is the frustration normal? Haha I've been trying to build functions with loops and if statements recently (because that's where I'm up to) @Bogden
14th Jun 2017, 7:38 AM
Ava Nicole
Ava Nicole - avatar
+ 3
The frustration is pretty normal in the firsts stages. I managed it thinking in python as a guy who does EXACTLY what you told him. For example, if I say "while you are in the street buy some cookies" mr Phyton is going to buy cookies forever once he goes out. So, he is your friend, but a really weird one. Before write any line of code, make a global idea of it, write a abstract in a notepad and divide the big problem in a ton of little ones, and solve them one by one. Doing that I'm sure you'll overcome the difficulties. And if not, ask for help (only when you tried it!! ^^)
15th Jun 2017, 12:02 AM
Hector94
+ 3
@Hector94 thank you for the advice! Recently I've been writing things down and it's been helping. I'm actually taking intro to computer science this summer online from my college so I'm working to learn python through that.
15th Jun 2017, 12:08 AM
Ava Nicole
Ava Nicole - avatar
+ 3
The frustration is absolutely, unequivocally normal. As children, we aren't learning our first language(s) with deadlines.
16th Jun 2017, 4:39 PM
Kirk Schafer
Kirk Schafer - avatar
+ 2
If anyone learning any language has any suggestions that would also be great!
14th Jun 2017, 12:23 AM
Ava Nicole
Ava Nicole - avatar
+ 2
Haha yeah I am working on it. I only started 2 weeks ago.
14th Jun 2017, 12:28 AM
Ava Nicole
Ava Nicole - avatar
+ 2
Yeah that makes sense @Jacob. I've been trying to do some simple ones. Ive had a hard time understanding loops and stuff. Im thinking that the struggle is normal though
14th Jun 2017, 12:32 AM
Ava Nicole
Ava Nicole - avatar
+ 1
Practice a lot. Maybe start with a simpler problem and see how to solve that, and then answer harder ones.
14th Jun 2017, 12:29 AM
Jacob Cremers
Jacob Cremers - avatar
+ 1
If you have exhausted your skill post code here and someone may/will give feedback
16th Jun 2017, 4:54 PM
Baard Helmen
Baard Helmen - avatar
+ 1
look at my latest published code. just tap my chat pic
16th Jun 2017, 5:00 PM
Baard Helmen
Baard Helmen - avatar
0
@Ava, I've posted a pendulum code for your todays 'exam' if you want an example of code to expand and make your own
16th Jun 2017, 4:57 PM
Baard Helmen
Baard Helmen - avatar
0
@BaardHelmen what do you mean?
16th Jun 2017, 4:58 PM
Ava Nicole
Ava Nicole - avatar