Conditional structures - Loops - Classes
One of the fairly common scenarios you'll run into in programming is making decisions. Your program needs to compare values and execute code based upon some logical outcome. And that's where conditional logic comes into play. In Python, conditionals are handled by the "if", "elif", "else" statement. - Repeating code over and over again, via a construct known as a loop, is also a fairly common scenario in programming. Python provides a couple of ways of doing that. Loops in Python work a little bit differently than you might be used to in other languages. For example, in JavaScript you have the concept of an index counter, that controls the number of iterations in a for loop. Alright, that's a brief look at loops in Python. - Just like other languages, such as JavaScript, Python gives you the option of writing code that is procedural or objected oriented. So, that you can use classes in Python. Classes are a really great way of encapsulating fu...
Nhận xét
Đăng nhận xét