1

I need to print a long const sentence in a python script and we follow the "not more than 80 chars a line" rule.

I know the following would work but is there a better way to write this?

print ("This is a reaaaaaaaaaaaaaaaaaaaaaaaally long "
       "sentencexxxxxxxxxxxxxxxxxxxxxxxxxxxx").format("")

or,

print ("This is a reaaaaaaaaaaaaaaaaaaaaaaaally long " +
        "sentencexxxxxxxxxxxxxxxxxxxxxxxxxxxx")

Or, if one of them is preferable than the other one.

Edit:To make it more clear, the expected output is,

This is a reaaaaaaaaaaaaaaaaaaaaaaaally long sentencexxxxxxxxxxxxxxxxxxxxxxxxxxxx

Fallen
  • 4,435
  • 2
  • 26
  • 46

1 Answers1

2

I think this is a better way:

print(
"This is a reaaaaaaaaaaaaaaaaaaaaaaaally long "
"sentence"
)

Actually, you need nothing to concatenate strings.

Sraw
  • 18,892
  • 11
  • 54
  • 87