computer science summer hw (gcse to alevel)Watch
https://www.codecademy.com/courses/learn-python (Good starting point for the basics. Online interactive lessons, everything is browser-based)
Otherwise, when it comes to writing code, remember that the "hard part" of programming is in solving problems. Every big, difficult and complicated programming problem can always be broken down into smaller, easier and simpler problems (Divide and Conquer). So if you don't know where to start with the problem you've been given, try writing a very small and simple program which only solves one small part of the problem by itself and take everything one step at-a-time.
Also Google and StackOverflow are great for finding answers to a lot of programming questions; remember that many people have been where you are, so if you're unsure how to do something in Python, then there's a pretty good chance that someone else will have asked and answered the same question on StackOverflow before. Make a habit out of using Google or StackOverflow searches such as "How to do ((something)) in Python" - for example
- How do I convert strings to numbers in Python?
- How do I read input from a user in Python?
- How do I read/write text files in Python?
- How do I ask a user to retry input in Python?
finding short, working example code on the internet can be helpful - it's sometimes good to be able to see how other people think about problem solving to try to understand their ways of thinking, and also to see a working example so that you can see what different parts of the language actually 'do', and also see different parts of the language being used together in new ways.
Once you know all the basic building-blocks (e.g. If/Else, For, While, Variables, Lists, Strings, Boolean logic, Numbers, etc.), then solving problems is going to be a case of fitting those together to do more useful things to actually solve problems - you will see the same basic patterns and combinations of those recurring all the time. For example, Lists and "For Loops" nearly always go together, as well as keeping hold of variables which can remember something which happened inside a loop.
Lastly, you might also find your life is a bit easier if you use a better IDE (development environment/code editor) to write Python. The built-in editor called IDLE is 'OK' but not really very good. Something more modern will help you with things like autocomplete, auto-indenting, error-highlighting, mouseover help, and most importantly a better 'debugger' which lets you pause a program on a specific line of code (using a "red dot") when it's running and inspect what's happening, stepping over the code line-by-line so you can see exactly what your code is doing (very useful for when it's not working the way you'd previously assumed..).
Try downloading PyCharm Community Edition (free version) -- https://www.jetbrains.com/pycharm/download/
- Some 'getting started' instructions: https://www.jetbrains.com/help/pycha...tutorials.html