Question

Write a function named "indexed_kvs" that doesn't take any parameters and returns a new key-value store...

Write a function named "indexed_kvs" that doesn't take any parameters and returns a new key-value store containing the integers from 0 to 29 as values each stored at a key which is a string containing the digits of the integer. For example the key-value "0":0 will be in your returned key-value store (include both 0 and 29 in your list)

0 0
Add a comment Improve this question Transcribed image text
Answer #1
def indexed_kvs():
    d = {}
    for i in range(30):
        d[str(i)] = i
    return d


print(indexed_kvs())
Add a comment
Know the answer?
Add Answer to:
Write a function named "indexed_kvs" that doesn't take any parameters and returns a new key-value store...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT