I did python.. awhile back, it was like ruby in some ways and in some ways not. So I picked one, I went full blown into Ruby. Recently I’ve seen lots of job postings for Python so I figured I’d give it another go :)
1 2 3 4 5 6 7
Then in ruby
1 2 3 4 5 6 7 8
Eveything in ruby is an object and objects have methods. String has a method slice, aliased to
 (cool!) and the
.. is a range. You could use a comma but there is so way to tell it to use the end unless using a range. If you look at the params for the slice method it is a
fixnum, fixnum or a range. It can also take a string (if you use the method name) but that is a strange use.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Unless you use
slice! (bang) does it actually change/do anything remotely interesting. Probably I would find a more clear way to do it than using slice with a string.
Well this is just one aspect of the differences and I am not sure if there are differences in the versions of python too.