NOTE: P -> Python, R -> Ruby
P: >>> 13/4 # 3.25
R: > 13/4 => 3
P: >>> print = "hello"
>>> print
'hello'
>>> print("hello world")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'str' object is not callable
R: >> print = "hello"
=> "hello"
>> print
=> "hello"
>> print("hello world")
hello world=> nil
P: >>> hash["c"]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'c'
R: >> hash[:c]
=> nil
P:
>>> class Website:
pass
>>> github = Website()
>>> github.url = "https://github.com"
>>> github.url
'https://github.com'
R:
>> class Website
>> end
=> nil
>> github = Website.new
=> #<Website:0x00007f912d88f0c0>
>> github.url = "https://github.com"
Traceback (most recent call last):
...
NoMethodError (undefined method `url=' for #<Website:0x00007f912d88f0c0>)