Gave me a segment of code and asked what it would output.
Write a function that takes a Python code snippet as a string and returns the exact text that would be printed when the snippet runs. Assume the snippet is valid Python and only uses print for output. Preserve newlines and spacing exactly as produced by Python.
def predict_output(code):
code: a string containing a Python snippetdef predict_output(code):