Mar-25-2020, 07:45 PM
Start by solving the problem on pencil and paper. Don't think about dictionaries or python. Carefully document the steps taken to solve the problem without ambiguity. Is your solution general? If you changed the inputs does it still calculate the correct answer? If so you have just created an algorithm. Congrats!
Once you have the algorithm writing a program is mostly finding the right syntax and data structures. Programming is far simpler than coming up with the algorithm, and coming up with an algorithm is simpler if you aren't thinking about how you would write the program. There will come a time when you'll see multiple algorithms for solving a problem and programming language will affect which algorithm you choose to implement, but that time is in your future.
Once you have the algorithm writing a program is mostly finding the right syntax and data structures. Programming is far simpler than coming up with the algorithm, and coming up with an algorithm is simpler if you aren't thinking about how you would write the program. There will come a time when you'll see multiple algorithms for solving a problem and programming language will affect which algorithm you choose to implement, but that time is in your future.