Created
April 30, 2020 16:04
-
-
Save raeq/a3fa2cea2fb5e60af4aa6c25472bcdde to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Let's define a string to begin with. | |
sentence = "The quick brown fox jumped over the lazy dog." | |
#let's show the string with all characters in lower case | |
print(f"Lower case representation:\n{ sentence.lower() }") | |
#let's show the string with all characters in title case | |
print(f"Title case representation:\n{ sentence.title() }") | |
#let's show the string centered with 80 chracters | |
print(f"Center :\n{ sentence.center(80) }") | |
#let's count how many times the letter e occurs in the string | |
print(f"Count of the character e:\n{ sentence.count('e') } ") | |
#let's count how many characters in total the string has. | |
print(f"Count of any character:\n{ sentence.count('') } ") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment