def simple_assembler(program):
for instruction in program:
for element in instruction:
if element.isdigit() == True:
return element
simple_assembler(['mov a 5','inc a','dec a','dec a','jnz a -1','inc a'])
This code works but once it finds the first case that is true and returns the element, the program terminates. It should iterate through the entire program
, which is a list of strings. Thanks