0
test2 = [1,2,3,4,5]

print(f'The following Attributes are not supported \n {"\n".join([str(i) for i in test2])}')

Intended output:

The following Attributes are not supported
1
2
3
4
5

Is there any way I could achieve this whilst keeping it on the same line? The error received is as follows: Unterminated expression in f-string; missing close brace

Br3xin
  • 116
  • 6

1 Answers1

1

You can use chr(10) instead of '\n':

print(f'The following Attributes are not supported \n{chr(10).join([str(i) for i in test2])}')
Unmitigated
  • 76,500
  • 11
  • 62
  • 80