Advertisement
# Signature of lower() method
lower()
# Python - Method lower() Example
# Creating a string
s1 = ('KING KONG IS COMING!')
# Printing the original string
print('Value of string : ', s1)
# Calling the lower() method on string object
print('Calling the lower() method on string : ', s1.lower())
Value of string : KING KONG IS COMING!
Calling the lower() method on string : king kong is coming
Advertisement
# Python - Method lower() Example
# Creating a string
s1 = ('Jupiter - The Biggest Planet of our Solar System')
# Printing the original string
print('Original string before calling lower() : ', s1)
# Calling the lower() method on string object
print('Calling the lower() method : ', s1.lower())
# Printing the original string
print('Original string after calling lower() : ', s1)
String's value : Jupiter - The Biggest Planet of our Solar System
Calling the lower() method : jupiter - the biggest planet of our solar system
Original string after calling lower() - Jupiter - The Biggest Planet of our Solar System
# Python - lower() method example.
# Creating a string
s = 'C\'mon, get up and fight!'
# Printing the original string
print('Original string is : ', s)
# Result of calling lower() is made to reference by the reference of original string.
s= s.lower()
# Old reference variable pointing to the new string
print('String value after lower() : ', s)
Original string value : C'mon get up and fight!
String value after lower() : c'mon get up and fight!
Advertisement
Advertisement
Please check our latest addition
C#, PYTHON and DJANGO
Advertisement