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
String Case Convertion
- Uppercase: Convert to uppercase using .upper() in Python, .toUpperCase() in JS
- Lowercase: Convert to lowercase using .lower() in Python, .toLowerCase() in JS
print("hello".upper())
print("HELLO".lower())
HELLO
hello
%%js
console.log("hello".toUpperCase());
console.log("HELLO".toLowerCase());
<IPython.core.display.Javascript object>
- Use Case: Useful for standardizing text inputs, like making email addresses case-insensitive