I'm trying to learn string formatting in Python and I was wondering if you can do something like this:
print(f'{element[i].key}: {element[i]}\n{element[i].key}:{element[i]}\' for i in range(2))
Basically, I want to run a for loop within a print so I can iterate and print different values within a dictionary. I feel like I have seen something like this before but I have no idea what the name of it is or how to do it.