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 | |
text1 = 2019 | |
print(type(text1)) | |
text2 = '2019' | |
print(type(text2)) | |
text3 = 'Python String' | |
print(type(text3)) |
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 | |
text = " Let us learn strip in python " | |
# assign vales to list | |
list =["lets", "learn", "strip"] | |
# when strip() on the list method error | |
print(list.strip()) |
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 extra characters | |
str = '@@@@Let us learn about strip function in Python!!!!!!!!!!'; | |
# Prints the original value of the string | |
print str | |
# removes only the leading characters in the string | |
print("\nLeft Strip") |
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') |
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 | |
# A custom function to check the count of the string | |
def countStr(text): | |
print("Length of the string before strip()") | |
print(len(text)) | |
# Using strip() to remove white spaces | |
str = text.strip() |
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 extra characters | |
str = '@@@@Let us learn about strip function in Python!!!!!!!!!!'; | |
# Prints the original value of the string | |
print str | |
# Prints the striped value of the string | |
print str.strip('@!') |
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 | |
str = ' Let us learn about strip in Python! \n'; | |
print str | |
print str.strip() |
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
<html> | |
<style> | |
.cssmarquee { | |
height: 50px; | |
overflow: hidden; | |
position: relative; | |
} | |
.cssmarquee h1 { | |
position: absolute; | |
color: turquoise; |
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
<style> | |
.cssmarquee { | |
height: 200px; | |
overflow: hidden; | |
position: relative; | |
} | |
.cssmarquee h1 { | |
position: absolute; | |
color: turquoise; | |
width: 100%; |
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
<html> | |
<style> | |
.cssmarquee { | |
height: 50px; | |
overflow: hidden; | |
position: relative; | |
} | |
.cssmarquee h1 { | |
position: absolute; | |
width: 100%; |