Boston Python Workshop 3/Friday/Tutorial: Difference between revisions
Content added Content deleted
imported>Jesstess |
imported>Jesstess |
||
Line 297: | Line 297: | ||
Like the <code>type</code> function from before, the <code>str</code> function takes 1 argument. In the above example it took the integer 1. <code>str</code> takes in a Python object as input and produces a string version of that input as output. |
Like the <code>type</code> function from before, the <code>str</code> function takes 1 argument. In the above example it took the integer 1. <code>str</code> takes in a Python object as input and produces a string version of that input as output. |
||
===String length=== |
|||
There's another useful function that works on strings called <code>len</code>. <code>len</code> returns the length of a string as an integer: |
There's another useful function that works on strings called <code>len</code>. <code>len</code> returns the length of a string as an integer: |