Using Variables Base 10 Digits Set Range Base Write Dictionary Comprehension Maps Integer Q24041372

. Using the variables base=10 and digits=set(range(base)), writea dictionary comprehension that maps each integer between zero andnine hundred ninety nine to the list of three digits thatrepresents that integer in base 10. That is, the value should be{0: [0, 0, 0], 1: [0, 0, 1], 2: [0, 0, 2], 3: [0, 0, 3], …, 10:[0, 1, 0], 11: [0, 1, 1], 12: [0, 1, 2], …, 999: [9, 9, 9]} 2Your expression should work for any base. For example, if youinstead assign 2 to base and assign {0,1} to digits, the valueshould be {0: [0, 0, 0], 1: [0, 0, 1], 2: [0, 1, 0], 3: [0, 1, 1],…, 7: [1, 1, 1]}

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *