I am beginner in python i wanna add a substring in my python code. Here is my code
def gen_qr_text(acc_id,amount):
pp_acc_id = ""
pp_amount = ""
pp_chksum = ""
if len(acc_id) == 15:
pp_acc_id = "0315" + acc_id
elif len(acc_id) == 13:
pp_acc_id = "0213" + acc_id
elif len(acc_id) == 10:
pp_acc_id = "01130066" + acc_id.substring(1)
else:
return "null"
if not amount:
pp_amount = str.format("54%02d%s", len(amount), amount)
pp_str = "00020101021129370016A000000677010111" + pp_acc_id + "5303764" + pp_amount + "5802TH" + "6304"
pp_chksum = str(crc(pp_str))
pp_str += pp_chksum
return pp_str
It makes some error in my code. Here is the line:
pp_acc_id = "01130066" + acc_id.substring(1)
i wanna update to add substring. I converted this code from java. What should i do to convert this line in python.