Answers for "how to make a character uppercase in python"

19

capitalize string python

# Python string capitalization
string = "this isn't a #Standard Sntence."
string.capitalize() # "This isn't a #standard sentence."
string.upper() # "THIS ISN'T A #STANDARD SENTENCE."
string.lower() # "this isn't a #standard sentence."
string.title() # "This Isn'T A #Standard Sentence."

# ---------- Alternate Title Case ----------
# "This Isn't A #standard Sentence."

from string import capwords
string = capwords(string) # capitalize characters after each separator.
# see the doc: string.capwords(s, sep=None), separator defaults to space

# or implement it directly:
string = " ".join(s.capitalize() for s in string.split())
#
Posted by: Guest on December-01-2020
25

python to uppercase

text = "Random String"
text = text.upper() #Can also do 
text = upper(text)
print(text)

>> "RANDOM STRING"
Posted by: Guest on September-16-2020
2

python capitalize the entire string

message="hi"
print(message)
print(message.upper())
Posted by: Guest on January-09-2020
2

python method to check for uppercase character

a="DEMO"
print(a.isupper())
Posted by: Guest on August-07-2020

Code answers related to "how to make a character uppercase in python"

Python Answers by Framework

Browse Popular Code Answers by Language