Instant method grammar for Python and Ruby (studying)

This time as a study of Python and Ruby I would like to compare the grammar of instance methods. Instance methods are the basic content of object-oriented programming. I would like to compare in various languages.

The Python and Ruby used this time are implemented in the following versions. Python: 3.7.4 Ruby: 2.6.3

Example in Python

test.py



class Test:
     def __init__(self):
          print('During study')

Example in Ruby

test.rb


class Test
     def initialize
         puts('During study')
     end
end

When compared, I get the impression that the presence or absence of ":" and "end" is different.

We will update it from time to time.

Recommended Posts

Instant method grammar for Python and Ruby (studying)
Ruby, Python and map
Python and Ruby split
Comparison of Python and Ruby (Environment / Grammar / Literal)
Comparison of CoffeeScript with JavaScript, Python and Ruby grammar
Python on Ruby and angry Ruby on Python
Python and ruby slice memo
Python installation and basic grammar
Ruby and Python syntax ~ branch ~
Basic Python grammar for beginners
[Python] Sample code for Python grammar
Python (Python 3.7.7) installation and basic grammar
List method argument information for classes and modules in Python
Summary of Hash (Dictionary) operation support for Ruby and Python
Difference between Ruby and Python split
Java and Python basic grammar comparison
Scraping with Node, Ruby and Python
Minimum grammar notes for writing Python
[Python] Difference between function and method
Studying python
Differences between Ruby and Python in scope
[Comparison of PHP, Ruby, and Python description] For those who are wondering how the description method is different.
Eating and comparing programming languages: Python and Ruby
6 Python libraries for faster development and debugging
[Basic grammar] Differences between Ruby / Python / PHP
[Python] Difference between class method and static method
Encrypt with Ruby (Rails) and decrypt with Python
Easy web scraping with Python and Ruby
Differences between Ruby and Python (basic syntax)
SublimeText2 and SublimeLinter --Syntax check for Python3--
Difference in writing method to read external source code between Ruby and Python
Memo # 4 for Python beginners to read "Detailed Python Grammar"
Correspondence summary of array operation of ruby and python
Dart grammar for those who only know Python
Causal reasoning and causal search with Python (for beginners)
(Windows) Causes and workarounds for UnicodeEncodeError on Python 3
Specifying the range of ruby and python arrays
Memo # 3 for Python beginners to read "Detailed Python Grammar"
Memo # 1 for Python beginners to read "Detailed Python Grammar"
[Python for Hikari] Chapter 09-02 Classes (Creating and instantiating classes)
Memo # 2 for Python beginners to read "Detailed Python Grammar"
[Python / Chrome] Basic settings and operations for scraping
PDF files and sites useful for learning Python 3
Memo # 7 for Python beginners to read "Detailed Python Grammar"
Memo # 6 for Python beginners to read "Detailed Python Grammar"
About shallow and deep copies of Python / Ruby
Memo # 5 for Python beginners to read "Detailed Python Grammar"
Install Python and libraries for Python on MacOS Catalina
2016-10-30 else for Python3> for:
python [for myself]
python grammar check
Install PyCall on Raspberry PI and try using GPIO's library for Python from Ruby
[Python] Start studying
Python grammar notes
Python3 basic grammar
Johnson method (python)
[Python] Semi-Lagrange method
Rock-paper-scissors poi in Python for beginners (answers and explanations)
Initial settings for using Python3.8 and pip on CentOS8
[Python for Hikari-] Chapter 06-04 Functions (arguments and return value 3)
Studying Footprint Automation for Matching Apps (Python, Selenium, BeautifulSoup,)