I have a data structure called Deny
:
{'1': {'From': '00:00:00:00:00:02', 'To': '00:00:00:00:00:01'},
'2': {'From': '00:00:00:00:00:03', 'To': '00:00:00:00:00:04'}}
I need to loop through to print values associated with From and To. Here's what I have so far:
Calling the function:
self.Add(*Deny)
Called function:
def Add(*Deny):
for x in Deny.values():
log.debug("From is %s",x['From'])
log.debug("To is %s",x['To'])
I get error message like: 'tuple' object has no attribute 'values'
. I'm expecting an output like this:
From is 00:00:00:00:00:02
To is 00:00:00:00:00:01
From is 00:00:00:00:00:03
To is 00:00:00:00:00:04
Can anyone suggest a solution for this for
loop?