Question: Write the function is _ nested which takes a dictionary and returns a boolean value. Return True if the given dictionary is a nested dictionary;
Write the function isnested which takes a dictionary and returns a boolean value. Return True if the given dictionary is a nested dictionary; return False if not. For the purposes of this exercise, a nested dictionary is any dictionary with a list, tuple, or dictionary as a value.
Test Case
Using the given dictionary and function call below:
# test code below
if namemain:
exampledict
: 'one',
: 'two',
: 'three'
printisnestedexampledict
Your script should print:
False
TRY IT
Test Case
Using the given dictionary and function call below:
# test code below
if namemain:
exampledict
:
: 'four',
: 'five'
printisnestedexampledict
Your script should print:
True
TRY IT
Test Case
Using the given dictionary and function call below:
# test code below
if namemain:
exampledict
: 'one',
: :
: 'five'
printisnestedexampledict
Your script should print:
True
TRY IT
Test Case
Using the given dictionary and function call below:
# test code below
if namemain:
exampledict
: 'one',
: 'two',
:
printisnestedexampledict
Your script should print:
True
TRY IT
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
