Fall 2024 - P1
Big Idea 3 | .1 | .2 | .3 | .4 | .5 | .6 | .7 | .8 | .10 |
3.4 String Operations
3.4 Team Teach String Operations
Measuring String Length
- The len() function in Python allows us to find the length of a string
- Use .length in JavaScript to do this as well
print(len("Hello"))
5
- Use Case: Determine number of characters in string (eg for validation of password length)
%%js
console.log("Hello".length);
<IPython.core.display.Javascript object>