fork download
  1. def textProperSpacing(textInput, spaceNumber=16):
  2. return textInput + (spaceNumber - len(textInput)) * " "
  3.  
  4.  
  5.  
  6. print textProperSpacing("ham spam") + "-"
  7. print "ham spam".ljust(16, " ") + "-";
Success #stdin #stdout 0.01s 7728KB
stdin
Standard input is empty
stdout
ham spam        -
ham spam        -