Tags » String Format

Python: formatter

Below shows how to do more complicated string formatting. Refer below for the sample code:

formatter = "{} {} {} {}"

print(formatter.format(1,2,3,4))
print(formatter.format("one","two","three","four"))
print(formatter.format(False, False, True, False))
print(formatter.format(formatter, formatter, formatter, formatter)
print(formatter.format(
  "First thing",
  "that we can try",
  "maybe is having",
  "a line of sentence"))
… 125 more words
Experience Sharing

Day 9: Slicing & Index of Strings in Python

Previously, I mentioned that string can be indexed and has slicing method. I am continue with strings’ indexes and slicing in Python.

Strings can be… 356 more words

Experience Sharing