Skip to main content
deleted 167 characters in body; edited title
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

Flatten Dictionary pythonPython challenge

I have got a question about this coding challenge for Flatten"Flatten a DictionaryDictionary".:

Given a dictionary dict, write a function flattenDictionary that returns a flattened version of it .

If you’re using a compiled language such Java, C++, C#, Swift and Go, you may want to use a Map/Dictionary/Hash Table that maps strings (keys) to a generic type (e.g. Object in Java, AnyObject in Swift etc.) to allow nested dictionaries.

Example:

Input:

> input:  dict = {
>             "Key1" : "1",
>             "Key2" : {
>                 "a" : "2",
>                 "b" : "3",
>                 "c" : {
>                     "d" : "3",
>                     "e" : "1"
>                 }
>             }
>         }
> 
> output: 

Output:

{
>             "Key1" : "1",
>             "Key2.a" : "2",
>             "Key2.b" : "3",
>             "Key2.c.d" : "3",
>             "Key2.c.e" : "1"
>         }

Flatten Dictionary python challenge

I have got a question about this coding challenge for Flatten a Dictionary.

Given a dictionary dict, write a function flattenDictionary that returns a flattened version of it .

If you’re using a compiled language such Java, C++, C#, Swift and Go, you may want to use a Map/Dictionary/Hash Table that maps strings (keys) to a generic type (e.g. Object in Java, AnyObject in Swift etc.) to allow nested dictionaries.

Example:

> input:  dict = {
>             "Key1" : "1",
>             "Key2" : {
>                 "a" : "2",
>                 "b" : "3",
>                 "c" : {
>                     "d" : "3",
>                     "e" : "1"
>                 }
>             }
>         }
> 
> output: {
>             "Key1" : "1",
>             "Key2.a" : "2",
>             "Key2.b" : "3",
>             "Key2.c.d" : "3",
>             "Key2.c.e" : "1"
>         }

Flatten Dictionary Python challenge

I have a question about this coding challenge for "Flatten a Dictionary":

Given a dictionary dict, write a function flattenDictionary that returns a flattened version of it .

If you’re using a compiled language such Java, C++, C#, Swift and Go, you may want to use a Map/Dictionary/Hash Table that maps strings (keys) to a generic type (e.g. Object in Java, AnyObject in Swift etc.) to allow nested dictionaries.

Example:

Input:

dict = {
    "Key1" : "1",
    "Key2" : {
        "a" : "2",
        "b" : "3",
        "c" : {
            "d" : "3",
            "e" : "1"
        }
    }
}

Output:

{
    "Key1" : "1",
    "Key2.a" : "2",
    "Key2.b" : "3",
    "Key2.c.d" : "3",
    "Key2.c.e" : "1"
}
make existing text into hyperlink
Source Link

I have got a question about this coding challenge for Flatten a Dictionary.

Link to the challenge: https://github.com/NeverDoubtTheWorm/Pramp/tree/master/Flatten_Dictionarythis coding challenge for Flatten a Dictionary.

I have got a question about this coding challenge for Flatten a Dictionary.

Link to the challenge: https://github.com/NeverDoubtTheWorm/Pramp/tree/master/Flatten_Dictionary

I have got a question about this coding challenge for Flatten a Dictionary.

Added link to the challenge:
Source Link
NinjaG
  • 2.6k
  • 2
  • 30
  • 61

I have got a question about this coding challenge for Flatten a Dictionary.

Link to the challenge: https://github.com/NeverDoubtTheWorm/Pramp/tree/master/Flatten_Dictionary

I have got a question about this coding challenge for Flatten a Dictionary

I have got a question about this coding challenge for Flatten a Dictionary.

Link to the challenge: https://github.com/NeverDoubtTheWorm/Pramp/tree/master/Flatten_Dictionary

Post Reopened by Simon Forsberg
update grammar, make formatting match description found on sites like https://gist.github.com/aaronago/745ae48d70246105112dbadb9ff88675
Source Link
Loading
update the original question
Source Link
NinjaG
  • 2.6k
  • 2
  • 30
  • 61
Loading
Post Closed as "Needs details or clarity" by Graipher, Sᴀᴍ Onᴇᴌᴀ, t3chb0t, Donald.McLean, Mast
Source Link
NinjaG
  • 2.6k
  • 2
  • 30
  • 61
Loading