Seems like the "ec2_con_re.instances" you are using is a string but it should be an ec2 object. First, create the ec2 object and then run the loop. Refer to the below code:
ec2_con_re = boto3.resource('ec2')
def get_instant_state():
pr_st=[each.state['Name'] for each in ec2_con_re.instances.filter(Filters=[{'Name':'instance-id',"Values":[in_id]}])]
return render_template("trial3.html",msg=pr_st)