Getting nameerror in python -
i have following function, want concat 2 strings, wrong doing here?
commands = ["abcd","123"] def configure_dev(self, steps): func_name = self.id + ':configure dev' global conf_cmd key in commands: conf_cmd += key + '\n' print(conf_cmd)
getting following error:
conf_cmd += key + '\n'
after running it, error: nameerror: name 'conf_cmd' not defined
i added code critical issue resolved.
commands = ["abcd","123"] def configure_dev(self, steps): func_name = self.id + ':configure dev' global conf_cmd = '' // <-- '' key in commands: conf_cmd+=key+'\n' print(conf_cmd)
Comments
Post a Comment