python from code2flow import parser, flowchart def calculate_sum(numbers): total = 0 for num in numbers: total += num return total if __name__ == '__main__': input_numbers = [1, 2, 3, 4, 5] result = calculate_sum(input_numbers) print("Sum of numbers:", result) python if __name__ == '__main__': input_numbers = [1, 2, 3, 4, 5] result = calculate_sum(input_numbers) parsed_code = parser.parse_code(calculate_sum) parsed_code['blocks'][-1]['exit'] = True flowchart.generate_file(parsed_code, 'flowchart.html') print("Flowchart generated successfully.")


上一篇:
下一篇:
切换中文