-
Notifications
You must be signed in to change notification settings - Fork 0
Completed about_dictionaries koan #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
self.assertEqual(__, cards['yellow dwarf']) | ||
self.assertEqual(5, len(cards)) | ||
self.assertEqual(42, cards['green elf']) | ||
self.assertEqual(42, cards['yellow dwarf']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: line break before end of file.
self.assertEqual(2, len(babel_fish.values())) | ||
self.assertEqual(True, 'one' in babel_fish.keys()) | ||
self.assertEqual(False, 'two' in babel_fish.values()) | ||
self.assertEqual(False, 'uno' in babel_fish.keys()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: What type are the return values of values()
and keys()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It returns list
for both.
self.assertEqual(__, babel_fish['one']) | ||
self.assertEqual(__, babel_fish['two']) | ||
self.assertEqual('uno', babel_fish['one']) | ||
self.assertEqual('dos', babel_fish['two']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q1: Can None
be a valid key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it can.
self.assertEqual(__, babel_fish['one']) | ||
self.assertEqual(__, babel_fish['two']) | ||
self.assertEqual('uno', babel_fish['one']) | ||
self.assertEqual('dos', babel_fish['two']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q2: Can None
be a valid value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also can.
self.assertEqual(__, babel_fish['one']) | ||
self.assertEqual(__, babel_fish['two']) | ||
self.assertEqual('uno', babel_fish['one']) | ||
self.assertEqual('dos', babel_fish['two']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May sound like an Idle question, but None
is precisely the return value of any function if you forget to call return
on it...
Completed and ready for review!