Is Python basically a prerequisite for every other language? I have a problem, but I'm stuck on how to solve it.

To echo what several others are saying here, if you're bored learning Python jumping into another language is just going to add difficulty to boredom. And it's not entirely your fault.... Going by a class just for the sake of learning without doing something that sparks your interest is difficult and not really productive. Write things on the side for fun while doing a tutorial/class/book.

I highly recommend Think Like a Computer Scientist - Python Edition. I learned from it and every section has you working and elaborating upon a small one-off project that keeps your interest.

I also recommend beginning on very simple versions of the program you're wanting to write, and when you encounter a concept of which you're unfamiliar (which should probably be immediately) then just Google it, and take care of that one problem. Break it down into the smallest possible chunk and don't proceed until that chunk is finished and bug-free. E.G.:

Q. "What will my inventory system have?" A. "Well, first it has to have a calculator. I'll make that." Q. "What kind of calculator will it be?" A. "A simple calculator. It should be able to take a string of inputs, e.g. 1 + 4 * (9 / 5)." Q. "How do I make a calculator that performs multiple operations on one line?" A. (Google!) "I can make a function that uses recursion." Q. "What is a function?" A. (Google.) "It's what it sounds like, a code that takes care of or calculates whatever info it's fed. I'll feed it a string input by the user."

Then you have a skeleton of a program:

def calculate(s):
    # This will recursively solve the problem. I'll write this later.
    pass

myNum = input("GIVE ME A MATH: ")
print(myNum + " = " + calculate(myNum))

So once you have a skeleton of your program, go and fill in a detail at a time. Google things you're not familiar with. "What is recursion?" "How do I turn a string into a number?" "How do I make sure these are being calculated in the correct order?" Etc.

Once you're finished with your calculator, congrats. Now on to the next part of the project. Doing this will make it manageable, where you can sit down, write, finish, and perfect one part of your program. It's easier and far more satisfying than trying to truck through without a plan, make 2% progress on a hundred different task, and end up with innumerable bugs.

I wish you the best of luck. Don't give up!

TL;DR - Think of your overall goal, then continually break it down further and further until you have the smallest possible task to accomplish. Keep completing these mini-tasks, then work on piecing them together. Google is your best friend.

/r/learnprogramming Thread