1

In Python the code could be something like the following:

# 17 spaces have been allotted, this would pad 7 blank spaces to the left
# of the string because the string itself is 10 characters long and 

print 'Work Phone'.ljust(17)
Michael Swartz
  • 743
  • 1
  • 12
  • 22
  • 1
    I don't _believe_ so. I'm pretty sure I ended up writing my own `padLeft` and `padRight` methods because none were available in the JDK. I'll let some who's a bit more confident submit an answer (I'm on a phone and can't easily verify). – Mike Strobel Sep 15 '17 at 11:14
  • 2
    It's always encouraging to come here for help and get down voted for asking because I don't know. – Michael Swartz Sep 15 '17 at 11:14
  • It would probably be useful to briefly explain what those methods are supposed to do, for those of us who are familiar with Java and not Python – Michael Sep 15 '17 at 11:15
  • @Dukeling --- thank you. You should post that as an answer. – Michael Swartz Sep 15 '17 at 11:17
  • @MichaelSwartz No answers on closed questions. We aggressively close duplicates because if we didn't it would be impossible to find anything on here :). – Mike Strobel Sep 15 '17 at 11:20
  • Not knowing is not an excuse. You have the whole internet at your fingertips, and searching is free. Why should we make an effort when you don't bother to? – Kayaman Sep 15 '17 at 11:20
  • @MikeStrobel *We aggressively close duplicates because it makes us feel important**. FTFY – Michael Sep 15 '17 at 11:22
  • I close duplicates because it's the fastest way to "finish" a question. It **is** impossible to find anything on here using the SO search, but Google works well. – Kayaman Sep 15 '17 at 11:31

0 Answers0