-1
<div>
    <b> "Key1" </b>
    " Value1 "
    <br>
    <b> "Key2" </b>
    " Value2 "
    <br>
    <b> "Key3" </b>
    " Value3 "
    <br>

Here i need the keys as keys in a dict 'A' and values as values of A[keys]

arjun
  • 345
  • 1
  • 4
  • 13

1 Answers1

0

I just tried another method and it is working.

  1. added the 'Key1','Key2','Key3' to a list named dict_keys
  2. added the 'Value1','Value2','Value3' to a list named dict_values
  3. made a dict by using zip() function;

    data_dict = dict(zip(dict_keys,dict_values))
    

Now the data_dict is the required dictionary which contains the keys and values

arjun
  • 345
  • 1
  • 4
  • 13