Computer Science Watch
I could really do with any tips/advice.
Otherwise, it's better to ask specific questions about programming/Python or whatever you happen to be struggling with. Although two things I can think of which are certainly worth doing if you haven't done so already:
(1) Use a good IDE (Integrated Development Environment -- i.e. code editor tools) to write your code with. Python has one which comes out-the-box called IDLE but it's not a very nice/friendly IDE. There's a much better tool called JetBrains PyCharm, which has a lot of features that are really helpful when learning for being able to understand what's happening and providing some built-in automatic assistance where/when you're going wrong. For example, decent auto-completion, error highlighting, mouse-over help, etc. These kinds of things are really useful while you're learning and can make the whole experience less frustrating (Community Edition is available free: https://www.jetbrains.com/pycharm/download/ )
(2) Make sure you learn how to use the debugger. a debugger will help you understand what your program is doing when it's running by letting you step through line-by-line and view what's happening with variables in your program (among other things). This is really important for diagnosing problems in your code, and can also be useful just for checking your assumptions (i.e. that what you "think" is happening really is happening). PyCharm has a few good guides on learning to use the debugger -- it should take you about 15 minutes to figure out how to use it, but it's something which could save you hours/days so it's an extremely important to skill to learn as early as possible:
Alternatively, you could simply print a representation of the game board using things like O, X, | and _. This will save getting familiar with tkinter
(btw it's not python 3 or 2.7)I can do simple code and can understand all the loops and syntax but I can't do extended programs/maths problems like finding Fibonacci numbers,etc.I am doing IGCSE Edexcel Computer science next year, so I'm preparing for that.
But the point really is that the 'hard part' of programming (regardless of whether you're writing a game, solving a maths problem, making a web app, etc.) is always in the the mindset of problem solving and computational thinking. The same methodology and way of thinking about solving a Fibonacci problem is also going to help you write a tic-tac-toe game.
To create the game, you need to spend time understanding what you're actually creating and what the game really is before you sit down to write any code. It's impossible to write code for something unless you fully understand the thing you're writing code for in the lowest level of detail.
In terms of a game, the first thing you need to do is be able to describe the rules of the game in exact detail - i.e. imagine you're trying to explain what the game is and how the game works to a 5-year-old child and to walk them through the entire game step-by-step, describing to them exactly what's going on at each point along the way. (As it turns out, explaining the rules of tic-tac-toe in that level of detail using plain English actually isn't anywhere near as simple or obvious as you might think).
For example - when the game starts, what do they see?
What does the first player do after the game starts?
What happens after the first player has made their first move? what do they see on the screen?
What does the second player do after the game starts?
What happens after the second player has made their first move? what do they see on the screen?
Then start looking at other rules such as what happens if the board is filled up?
what does it mean to win/lose? i.e. how would you describe the patterns and reasoning that decides whether a player has won or lost? What do they see on the screen?
Also remember that you neeed to define all the concepts that the game uses in terms that relate to something you can express in Python -- e.g. What is a board? what is a row or line? what is an O or X? etc.
Before you begin writing any code, make sure you have plain-English answers for all of these things -- answering those questions isn't actually as easy as it sounds. It's important to be able to think in the same terms as a computer. Remember that computers only understand really simple low-level concepts, and the Python language has a limited set of concepts as well, so you need to look at ways of using the programming concepts in Python to represent parts of your real problem.
Start out with small, simple problems. Don't try to solve everything at once. Problem-solving is a case of "divide and conquer" -- i.e. every big, difficult, complicated problem is actually just a series of smaller, easier, simpler problems; you just need to break it down into those smaller problems until they all become simple/obvious and easily solvable.
You might even end up writing some really long-winded, repetitive copy+paste code as well, and that's actually OK. Sometimes you need to write code the long way before you can visually spot the pattern and look at a way of generalising it. That's another good case for starting out with the easiest possible thing, because usually the easiest way to write code involves creating something which looks very inelegant -- being able to spot patterns in code and see ways of generalising to make the code more elegant is a slightly 'higher level' way of thinking which will start to feel more natural as you spend more time writing code.
When a problem feels too big and complicated, just break it down into small pieces and limit yourself to just solving one small part of a problem at any one time. You might even decide to write lots of very small throw-away programs which each only solve one small part of the game or try things out to see what works and what doesn't. For example:
How do you want to keep the current state of the game and board in memory? (Usually whenever you have multiple related "things" in memory then you need a list of something)
How do you want to display the board to the user?
How do you want to get an input from the user?
Are you doing a one-player or two-player game? (Hint: A two-player game is much easier to start with, you can add an automated/computer player later)
How do you want to implement the concept of players taking turns?
What logic might you use to check the state of the board for win/loss/draw?
Try to code the simplest thing you can do which solves the smallest part of a problem and get that working before moving onto the next thing. Also, always write small pieces of code and run the program very frequently (don't write dozens of lines of code all at once and then find yourself drowning in loads of errors, that is never a good way to write a program. When you have loads of errors in one program, you'll end up wasting hours chasing/fixing problems and probably end up throwing it away to start again). It's normal to write code in tiny steps -- programming is an "iterative" thing, whereby you gradually build up a solution from small pieces step-by-step. Nobody ever gets the whole solution right first time, but you might get little bits of it right.
Also, I mentioned the debugger in my previous post -- you will find running your code in a debugger. and using breakpoints will be really useful if your program doesn't work in the way you expect -- its good for spotting subtle mistakes like simple "off by one" counting errors, as well as NOT/AND/OR logic errors, and errors with empty variables, etc.
Also, don't forget that Google and StackOverflow will give you loads of answers to specific questions -- Typing asking questions like "How do I do [...] in Python" will get you a long way. e.g. "How do I count items in a list using Python?" or "how do I compare multiple variables in Python?" etc. Chances are when you're stuck someone else will have asked the same or similar question many times before on StackOverflow.