Skip to content

Conversation

@BasavrajSutagatti
Copy link

Assignment 1 completed. I have few doubts.

what the two statements give different result?
Statement 1:
a='Ho! ' * 3
b='Merry Christmas!'
a+b
"Ho! Ho! Ho! Merry Christmas"

Statement 2:
a='Ho!' * 3
b='Merry Christmas!'
puts a+b
Ho! Ho! Ho! Merry Christmas

Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't write puts or any print statement in method.
Swap method should only perform operation

@brgnepal
Copy link
Collaborator

brgnepal commented Oct 7, 2014

Statement 1:

a='Ho! ' * 3
b='Merry Christmas!' 
a+b
# It will only perform operation (irb give the result) Copy above in some file like test.rb and run it.

Statement 2:

a='Ho!' * 3
b='Merry Christmas!' 
puts a+b  # this is expected

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.

2 participants