I am new to learning python and a bit confused and hoping i can get some help.
I have a dict here
my_dict = { "abc":1, "bvc":2, "mnb":3}
I am getting the keys using :-
keys = my_dict.keys()
for key in keys:
print(key)
and i get the output:-
"abc"
"bvc"
"mnb"
How can i get the output in the same line like this?
"abc", "bvc", "mnb"
I tried using
print(key.join(' ')+',')
in my loop but it doesn't work as expected.
Any help will be appreciated.
list(my_dict.keys())?