Python Programming: How to make text lowercase & uppercase

October 11, 2019

By CountingPips.com

A quick and simple way to change all text into lowercase or uppercase letters using python.

input:

text = “New York City”

lowertext = text.lower()


Get our Weekly Commitment of Traders Report: - See where the biggest traders (Hedge Funds and Commercial Hedgers) are positioned in the futures markets on a weekly basis.




Get Our Free Metatrader 4 Indicators - Put Our Free MetaTrader 4 Custom Indicators on your charts when you join our Weekly Newsletter






print (lowertext)

output: new york city

or you can simply apply .lower() to ‘text’

text.lower()

output: new york city


Uppercase is the same process.

input:

text.upper()

output: NEW YORK CITY