Skip to content

Tag: dictionary

Python – Find distinct domains inside a list of dictionaries

I have a list (with dictionaries inside) and I want to know how many different domains are inside it. I have something like this: The desired result would look like this: Or maybe just: Both would be OK, so whatever is easier or faster I guess. I think I could use Regex for this, but maybe there are more pyth…

How to print dict key value dynamically?

I’m trying to print a dict key value dynamically. EX: As we see the key ‘waninfo’ and ‘1’ are fixed and i would like to use the keys after dynamically, like this: How can i do this? Answer If there’s a constant number of keys, it might be easiest to just declare separate va…