Skip to content

Conversation

@anupk18
Copy link

@anupk18 anupk18 commented Oct 13, 2014

No description provided.

@brgnepal
Copy link
Collaborator

Hi @skotwal,

Please review the Anup's pull request for Day1 assignment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont use puts inside the method.
Swap the values by using function swap.
and then print(puts) the values of a & b.

Also u can do by foll way,
def swap(a,b)
return b, a
end

Hint:- 1. parallel assignment/Multiple assignment in Ruby.
To swap values without creating third variable.
2. How function can return multiple values for in ruby.

@brgnepal
Copy link
Collaborator

Hi @anupk18 ,

Please check comments on your review.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of + operator please use string interpolation.
like :-
"#{ 'Ho! ' * 3 } Merry Christmas!"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants