Created
September 21, 2019 10:04
-
-
Save goyalrohit/27e1c8752595e9e44639701c9870c5e7 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/python | |
# Assing a value to a string with unwanted characters | |
str = ' Ok Let us learn about strip function in Python Ok'; | |
# Prints the original value of the string | |
print str | |
# Prints the striped value of the string after removing leading and trailing word 'Ok' | |
print str.strip(' Ok') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment