I read a lot of tutorials, but can not find how to iterate dict in string.format like this:
dict = {'this':'I','is':'am','title':'done'}
print(f'the key is {k for k,v in dict}')
print(f'the val is {v for k,v in dict}')
which I want a result like this:
the key is this is title
the val is I am done
so I can print variable length dict.
dict = {'this':'I','is':'am','title':'done'}
print(f'the key is {k for k,v in dict}')
print(f'the val is {v for k,v in dict}')
Then I got error.