>The two sentences I would like to use in the program is the following:
>"This is line one\nThis is line two!" so I write: text_message = "This is line
>one\nThis is line two!"
>The dictionary name and key/value pairs will be:
>my_sentences {'This':'This','is':'is','line':'line','one':'two'} # D
Hello,
I am trying to do the following:
Make a program using two sentences of about 8 words (total between the two
sentences). I would then like to create a dictionary {} and split the
words of each sentence using one sentence as a dictionary key and using the
other sentence for the dictionary v
"sudhanshu gautam" wrote
and setdefault used to set the value is side the dictionary if it does
not
lies inside the dictionary.
so why we use setdefault I think in place of setdefault first we should
convert that dictionary in the list and now we can add new value then
again
convert it in
sudhanshu gautam wrote:
I was reading about the python dictionaries
That is a good thing to do.
had finished some methods related to the dictionary.
No comprehend.
we used get and setdefault methods to get the value from the
dictionary if it lies inside it
and setdefault used to set the
I was reading about the python dictionaries had finished some methods
related to the dictionary.
we used get and setdefault methods to get the value from the dictionary if
it lies inside it
and setdefault used to set the value is side the dictionary if it does not
lies inside the dictionary.
so