I don't understand how all this works together. I'm confused on all the symbol names. I know the symbol_count is the dictionary. I know the all_symbols is the list. Then we have symbol, where did this come from? There is also symbols.items(). I just need a walk through of this code and how it is working a step at a time.
symbol_count = {
"A": 2,
"B": 4,
"C": 6,
"D": 8
}
def get_slot_machine_spin(rows, cols, symbols):
all_symbols = []
for symbol, symbol_count in symbols.items():
for _ in range(symbol_count):
all_symbols.append(symbol)
.items()
function of dict types