19/20 What is going on here?


I’m assuming that I should probably stop putting ‘puts’ into the def, specifically when messing with integers.


Let your method return the square and puts the return value.


did you also call square(13) and square(20) ?

Your function probably should return n**2
Then puts square(2) outside the function


This unit has a lesson on implicit return…

def square(n)
  n ** 2

puts square(25)    # 625


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.