The code provided has a method hello which is supposed to show only those attributes which have been explicitly set. Furthermore, it is supposed to say them in the same order they were set.
But it's not working properly.
Notes
There are 3 attributes
name
age
sex ('M' or 'F')
When the same attribute is assigned multiple times the hello method shows it only once. If this happens the order depends on the first assignment of that attribute, but the value is from the last assignment.
Examples
Hello.
Hello. My name is Bob. I am 27. I am male.
Hello. I am 27. I am male. My name is Bob.
Hello. My name is Alice. I am female.
Hello. My name is Batman.
'매일매일개발 > Codewars' 카테고리의 다른 글
codewars #55 Sum of Two Integers (6kyu) (0) | 2018.06.04 |
---|---|
codewars #54 Word a10n (abbreviation) (6kyu) (0) | 2018.06.01 |
codewars #52 Are they the "same"? (6kyu) (0) | 2018.05.30 |
codewars #51 Simple string indices (6kyu) (0) | 2018.05.29 |
codewars #50 String -> N iterations -> String (5kyu) (0) | 2018.05.28 |