On Readable Python Code

Standard

Python is an very nice high-level programming language that provides the user with an easy way to write readable and clean code. It is often the case when someone is learning a new tool or language that they are not aware of small features that would greatly improve the readability of their code.

For example, when I was learning Python I learned to iterate over a list the way I keep seeing it when reading code of beginner Pythonists. Here is an example of how you could iterate over the list:

for ix in range(len(a_list)):
    print(a_list[ix])

However, a better and Pythonic way is to use iterators:

for el in a_list:
    print(el)

This equally works for dictionaries and strings:

for key in a_dictionary:
    print(key)

for char in a_string:
    print(char)
Advertisement

Real-time Collaborative Coding with Github’s Teletype for Atom

Standard

Github announced today the Teletype package for Atom, package for real-time collaborative coding. Below is an animation and video of how it works.

https://camo.githubusercontent.com/6ca046b659fe0960dae68750a17577f97a0f6500/687474703a2f2f626c6f672e61746f6d2e696f2f696d672f706f7374732f74656c65747970652f636f64652d746f6765746865722e676966

via Github blog