我有以下字符串,我想A1用列表中的每个字符替换befcodes并打印它:
befcodes = ["A1","A2","A3","A4","A5","A6","A7","A8","A9","10","11","12","13","14","15","16","17","18","19","20"]
telegram = "$00;02;A1;00000000*49"
我想得到如下所示的输出:
$00;02;A1;00000000*49
$00;02;A2;00000000*49
$00;02;A3;00000000*49
......
$00;02;19;00000000*49
$00;02;20;00000000*49
我尝试了几种不同的字符串格式化和 for 循环方法,但没有完全掌握它的窍门。你们能帮我一下吗?
米脂