Be sure to like, share and comment to show your support for our tutorials.
=======================================
Channel - https://goo.gl/pnKLqE
Playlist For This Tutorial - https://goo.gl/EyZFti
Latest Video - https://goo.gl/atWRkF
Facebook - / mastercodeonline
Twitter - https://twitter.com/mastercodeonlin?l...
Website - http://mastercode.online
======================================
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'
a.lower()
'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.
a.lower() - We call our string via the variable and then call the lower string method on our string object.
'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.
On this page of the site you can watch the video online Python Lower String Method with a duration of hours minute second in good quality, which was uploaded by the user Code master 30 September 2015, share the link with friends and acquaintances, this video has already been watched 6,472 times on youtube and it was liked by 59 viewers. Enjoy your viewing!