First thing comes in my mind, why to compare these two language only? This may be because both are interpreted, agile languages with an object oriented philosophy and very huge communities support. However, though both languages share some ideas, syntax elements and have almost the same features the two communities have nothing in common.
Both the languages are very popular among the developer’s community (This is also one of the reasons to compare). Below are the top ten most popular languages in 2018 on GitHub based on opened pull request −
As the two programming languages are very popular among the coders. Let’s try to compare Python and ruby over different aspects.
|PURPOSE||Python was designed to emphasize productivity and code reusability||Ruby was created to make programming more fun, efficient and flexible.|
There is no one universally superior language above all, and each of them tend to be well suited to a particular domain of work.
There is not much difference between the Python and Ruby since these are very similar in nature, but have different approaches to solve problems.
Anything you can do in Python, you can also do it in Ruby and vice-versa. Which framework (django or Ruby on rails) is better isn’t more important than what the support is like for you and your teammates.
In general, if your project involved data science or you are interested in data science, Python should be your first choice because of its stable and widely used different data science libraries. However, if you plan on sticking with building web applications, then you may consider Ruby on Rails first, as there is very strong community built upon it and they are always on the bleeding edge. However, if you are more interested in building web application but would also like to learn a language that used more generally, check out python and django. As in python you will get much larger diverse community and lots of influence and support from the various industries that used it.