t329.py 282 B

12345678910111213
  1. print "foo".count('o')
  2. print "foo".count('')
  3. print "foobar".count("foo")
  4. print "foobar".count('xom')
  5. print "foobar".ljust(10)
  6. print ":"+"123456".center(10)+":"
  7. print ":"+"12345".center(10)+":"
  8. print ":"+"1234".center(10)+":"
  9. print "foobar".rfind('r')
  10. print "foobar".capitalize()