i want to know do we able to create dictionary into list via list comprehension… and in
n_list=[letter for letter in name]
what actually these “letters” define… what the core idea…
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi @Sky01,
Basically, you want to create a list from a dictionary, is that correct? Now, do you want to merge all keys and values of your dictionary into a list or create two separate lists, one for your keys and one for your values?
Let’s say you want to create one list containing both the key and values of your dictionary:
If you want to create different lists for both your key and your value, you can try :
Regards, KFSys