Although you can use the escape character \n to insert a newline character in a long string. But there’s a more convenient way — the triple quotation mark method.
We can use three single quotes or three double quotes as the start and end of a multi-line string without using the escape character \n.
print(' 'Microsoft has won a $10bn defence Department contract for cloud services at amazon's expense. On Oct. 25, the Pentagon announced that Microsoft has won a Defense Department cloud computing contract called JEDI. The 10-year deal will allow Microsoft to handle much of the Defense Department's data and communications. '' ')
Copy the code
Running results:
Microsoft won a $10 billion defense Department contract for cloud services at amazon’s expense.
On Oct. 25, the Pentagon announced that Microsoft has won a Defense Department cloud computing contract called JEDI. The 10-year deal will allow Microsoft to handle much of the Defense Department’s data and communications.
Isn’t it very convenient