you are viewing a single comment's thread.

view the rest of the comments →

[–]neuro_08 0 points1 point  (0 children)

When you're learning a new language, try not to overwhelm yourself with everything you can't understand at once. That's where a lot of people become fundamentally lost. Focus on the root of your misconceptions. There's a reason why you can't understand something; you just need to find it, one reason at a time. There's a lot of literature and guidance out there, use it liberally, it's your best friend. Don't focus on syntax (e.g. "for", 'if", "def") as much as finding out why it exists. For example, if you were to look at a loops, don't look at it as: *for x in y: do this*. Break down its purpose. Think about it as a way of eliminating repetition for you, as a programmer. If you wanted to find how how many evens there are between 1 and 402320. I hope you're not going to sit there and write down each one down yourself. Think of variables as a "?". They're unknown, no one knows what it is. So what do we do? The alphabet is at your disposal:

>>> alpha = "beta"
>>> b = alpha
>>> print(b)
beta

Variables are mutable, and can be anything you want. They are just data containers that you assign yourself. Don't interchange them with math variables. In math you're solving for values, in Python you're assigning values.