-4

When I tried to print content like following, it returned errors like invalid syntax

My runtime is python3.8

Where is the wrong point of this ?

print 'Content: {}'.format(content)

If someone has opinion,please let me know

Thanks

Heisenberg
  • 4,787
  • 9
  • 47
  • 76
  • In python 3x you need `()` around whatever you are printing, like this :`print('Content: {}'.format(content))` – Have a nice day Jul 07 '21 at 04:50
  • Does this answer your question? [Python3 Print Function](https://stackoverflow.com/questions/28347411/python3-print-function) – Amit Gupta Jul 07 '21 at 04:53

1 Answers1

0

This looks awfully like python 2 code. You need to provide parenthesis from python 3 onwards in print statements

print ('Content: {}'.format(content))

This will do too.

print(f'Content: {content}')