4 ms·
This is just a guess, but in ruby, you can perform methods directly on any value, such as "3.succ", which returns 4. I don't think that works in Python. Ruby
by rmidthun 13y ago
This is just a guess, but in ruby, you can perform methods directly on any value, such as "3.succ", which returns 4. I don't think that works in Python. Ruby allows you to extend any class with more methods, so you could create your own function and apply it directly to a number. In Python, you would need to pass that number into a function.
E.g. Ruby: (3.7).round opposed to Python round(3.7)