Does anyone know how to make this code into an f-string (if possible):
print(">>> Multi-line Comment", data, sep="\n")
So if there is 2 or more components in data it would print each in a new line. The above code works, its was just bugging me that I could do it for a single line, but couldn't for multiline.
For example: This works for a single line
print(f">>> Single-line Comment\n{data}")
This will work for if I know how many multilines there are, in this case 2:
print(f">>> Multi-line Comment\n{str.splitlines(data)[0]}\n{str.splitlines(data)[1]}")
Any ideas to make an f-string version more automated like print(">>> Multi-line Comment", data, sep="\n")
?