Fall 2024 - P5
Big Idea 3 | .1 | .2 | .3 | .4 | .5 | .6 | .7 | .8 | .10 |
3.4 Python Strings Popcorn Hacks
3.4 Python popcorn hacks
# Find the number of characters in your last name using len.
# Example:
length = len("Williams")
print(length)
# Use concat to merge your first and last name together.
# Example:
concat_string = "Trent" + "Williams"
print(concat_string)
# Use substring to show only the 3rd to 6th characters
# Example:
substring = concat_string[2:6]
print(substring)