Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions 4 - String variables/string_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
# lower will return the string in lowercase letters
print(sentence.lower())

# lower and upper will swap return the string in lower to upper and upper to lower letters
print(sentence.swapcase())

# capitalize will return the string with the first letter uppercase
# and the rest of the string in lowercase
print(sentence.capitalize())

# count will count the number of occurrences of the value specified
# in the string, in this case how many times the letter 'a' appears
print(sentence.count('a'))