How to Fill a Python String with Spaces?
Problem Formulation Given a Python string s with length k<=n. How to fill the string with n-k empty spaces on the left so that the new string has length n? Here are some examples: INPUT: ‘a’, n = 2 OUTPUT: ‘a ‘ INPUT: ‘hi’, n = 4 OUTPUT: ‘hi ‘ INPUT: ‘hi’, n = 2 … Read more