if attack_string is None:
error = "Attack type is not specified, list of available attacks\t"
error += attacks_list
raise AttributeError(error)
if attack_string not in attacks_list:
error = "Attack not available, list of available attacks\t"
error += attacks_list
raise AttributeError(error)
After Change
raise AttributeError("Attack type is not specified, "
"list of available attacks\t".join(attacks_list))
if attack_string not in attacks_list:
raise AttributeError("Attack not available "
"list of available attacks\t".join(attacks_list))
// Mapping attack from string to class.
attack_class = AVAILABLE_ATTACKS[attack_string]
return attack_class