Colab

"how much wood would a woodchuck chuck if a woodchuck could chuck wood".replace("wood", "***")

'how much *** would a ***chuck chuck if a ***chuck could chuck ***'
x="wood"

.replace(x, "***")

'how much *** would a ***chuck chuck if a ***chuck could chuck ***'
s = "how much wood would a woodchuck chuck if a woodchuck could chuck wood"

s.replace(x, "***")

'how much *** would a ***chuck chuck if a ***chuck could chuck ***'
s

'how much wood would a woodchuck chuck if a woodchuck could chuck wood'
s.count("wood")

4
s.endswith("woodchuck")

False
s.startswith("wood")

False
s.startswith("how much")

True
s.isalnum()

False
s.isalpha()

False
s.replace(" ", "").isalnum()

True
"123".isdigit()

True
"\r\n\t ".isspace()

True
bool("")

False
bool(" ")

True
"abc".islower()

True
"ABC".isupper()

True
"AbC".islower() or "AbC".isupper()

False
"Title Case Is When The First Letter Of Every Word Is Capitalized".istitle()

True
s[0].isupper()

False
s[0]

'h'
s

'how much wood would a woodchuck chuck if a woodchuck could chuck wood'
"wood" in s

True
"bananah" in s

False
"woodchuck chuck" in s

True