Python For Rubyists
If you are familiar with any one of the programming language this article will help you to jump directly to Python code.
Though the article’s title states it’s for rubyists, actually it is for everyone who is familiar with a programming language.
All the code examples are based on Python3.
Python code blocks are indented.
Setting up environment
Ruby tool Python equivalent
gem install <gem> is
pip install <package>
virtualenv Python Virtual Environments
Python has 2 types of data structures immutable and mutable. Mutable objects can be changed. Immutable objects once defined cannot be changed.
4 data structures
- String (immutable)
- List (mutable)
- Dictionary (mutable)
- Tuple (immutable)
The classic example of object oriented programming.