filmov
tv
Python Lower String Method

Показать описание
Be sure to like, share and comment to show your support for our tutorials.
=======================================
======================================
Python Lower String Method
In this Python tutorial we will look at the Python lower string method. The lower string method will take a string object and create a new one with all contents of the string object as lowercase characters. The lower string method takes no arguments.
Python Lower String Method Syntax
'String Object'.lower()
'String Object' - We create a string object
.lower() - The lower string method will make a characters in new string object lowercase.
Examples Of The Python Lower String Method
#Example 1
'This IS a String'.lower()
'this is a string'
#Example 2
'NEW STRING'.lower()
'new string'
#Example 3
a = 'ThIs My StRiNg'
'this my string'
Examples Explained
Example 1:
'This IS a String'.lower() - We create a new string object with some lowercase characters and some uppercase letters and then we call the lower string method on our object.
'this is a string' - We create a new string object that contains all lowercase characters.
Example 2:
'NEW STRING'.lower() - We create a new string object this time we use the caps lock button to do so. We then call our lower string method on our new string object.
'new string' - We are returned a lowercase string which in fact is a new string object.
Example 3:
a = 'ThIs My StRiNg' - We create a new string object and assign 'a' to represent the object as a variable.
'this my string' - We are returned a new string object that is all lowercase characters.
Conclusion
In this Python Tutorial we have taken a look at the Python lower string method which converts an existing string method into new string but also converts all the characters to lowercase. If you have any questions about the lower string method in Python leave a comment below.
=======================================
======================================
Python Lower String Method
In this Python tutorial we will look at the Python lower string method. The lower string method will take a string object and create a new one with all contents of the string object as lowercase characters. The lower string method takes no arguments.
Python Lower String Method Syntax
'String Object'.lower()
'String Object' - We create a string object
.lower() - The lower string method will make a characters in new string object lowercase.
Examples Of The Python Lower String Method
#Example 1
'This IS a String'.lower()
'this is a string'
#Example 2
'NEW STRING'.lower()
'new string'
#Example 3
a = 'ThIs My StRiNg'
'this my string'
Examples Explained
Example 1:
'This IS a String'.lower() - We create a new string object with some lowercase characters and some uppercase letters and then we call the lower string method on our object.
'this is a string' - We create a new string object that contains all lowercase characters.
Example 2:
'NEW STRING'.lower() - We create a new string object this time we use the caps lock button to do so. We then call our lower string method on our new string object.
'new string' - We are returned a lowercase string which in fact is a new string object.
Example 3:
a = 'ThIs My StRiNg' - We create a new string object and assign 'a' to represent the object as a variable.
'this my string' - We are returned a new string object that is all lowercase characters.
Conclusion
In this Python Tutorial we have taken a look at the Python lower string method which converts an existing string method into new string but also converts all the characters to lowercase. If you have any questions about the lower string method in Python leave a comment below.
Комментарии