• Home
  • Public Speaking
  • Travel

Coding in Python

If ready, lets start coding. I will create test methods, therefore create a class extending unittest:

1. First Remarks


2. Assertions



3. Types



4. Basic Operations



5. Multi Assignments



6. Strings


To declare strings, both ' ' or " " can be used.
In the usage of one, you can use the other inside the text. Another way of using one of them inside text is using with escape.
''' ''' and """ """ are other string signs. Everything between these are exactly copied to the string including new lines and other quotes.
For a long string, on IDE for a new line, use escape.

7. Range, List & Dicts



8. Casting



9. Conditions



10. Loops



11. Files



12. Exceptions



13. Comprehensions



14. Tuples



15. Regex



16. Procedures & Functions


These are defined before the class:

If a function is defined within the class, instead of before; then it should have a parameter; and called as self. :

17. Lambda



18. Classes



19. Pass


"pass" is not doing anything. But can be regarded as a reminder like TODO. In this case: We override the constructer of super, but nothing is implemented: