Ashies

PYTHON LAB 1b

Oct 4th, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. def right_justify(s):
  2.     l=len(s)
  3.     ss=s.zfill(70)
  4.     ll=len(ss)
  5.     lll=ll-l
  6.     print(lll)
  7.     x=ss[0:lll]
  8.     x=x.replace("0"," ")
  9.     print(x)
  10.     ans=x+s
  11.     print(ans)
  12. s=input("Enter any string \n")
  13. right_justify(s)
Add Comment
Please, Sign In to add comment