I want to center the following text using python 35 hi h

I want to center the following text using python 3.5

+---------------+

| hi! |

| how are you? |

| drive safely! |

+---------------+

Solution

str=\"hi!\";

str=\"how are you?\";

str=\"drive safely!\";

print str.center(40,\' \');

the basic syntax to get the characters to align center

I want to center the following text using python 3.5 +---------------+ | hi! | | how are you? | | drive safely! | +---------------+Solutionstr=\

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site