0

I write a method.

def additionner (x,y) 

  puts (x * y) 

end 

additionner(2,7)

It works, but if I make a space after calling the method, it doesn’t work, why? Note that there is no difference wether there is a space between the method name and the parenthesis inside the definition of the method.

def additionner (x,y)

  puts (x * y)

end

additionner (2,7)

(repl):4: syntax error, unexpected ‘,’, expecting ‘)’ additionner (2,7)

in version: ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]

4

0 回答 0