Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Object-Oriented Python (retired) Inheritance Instance Methods

peter keves
peter keves
6,854 Points

are keyword arguments basically key value pairs ?

are keyword arguments basically key value pairs ?

1 Answer

Not exactly.

A key value pair would be something like a list, you have a key (index) and a value at that key. Or a dictionary, you have key's and each key holds certain values.

Strings, on the other hand, don't work exactly the same way. You could definitely think of it was a key value pair, since you can call an index of the string, but it's not like a string is just a list of characters. A string is it's own specific data type. Sure, you can slice and read out letters at an index, but it's not like each index holds it's own specific object like in lists or dictionaries.

Or at least, that's how I understand it.

Hope that helps!