Boston Python Workshop 3/Friday/Tutorial: Difference between revisions
Content added Content deleted
imported>Jesstess |
imported>Jesstess |
||
Line 228: | Line 228: | ||
</pre> |
</pre> |
||
There's another useful function that works on strings called <code>len</code>. <code>len</code> returns the length of a string: |
|||
⚫ | |||
<pre> |
|||
string = "Hello" |
|||
len(string) |
|||
print len("triskaidekaphobia") |
|||
length = len("") |
|||
print length |
|||
</pre> |
|||
⚫ | |||
<pre> |
<pre> |