xxxxxxxxxx
a=input(a)
section_1=upper(a)
print(section_1)
xxxxxxxxxx
s=input()
new_str=""
for i in range (len(s)):
if s[i].isupper():
new_str+=s[i].lower()
elif s[i].islower():
new_str+=s[i].upper()
else:
new_str+=s[i]
print(new_str)
xxxxxxxxxx
text ="welcome to PYTHON Tutorial"
# capitalizes the first letter in string
# and keeps the rest of the string in lowercase
captialized_text= text.capitalize()
print(captialized_text)
xxxxxxxxxx
def n_upper_chars(string):
return sum(map(str.isupper, string))
xxxxxxxxxx
capitalize() - Converts the first character to upper case # e.g. "grepper".capitalize() => "Grepper"
xxxxxxxxxx
# plz suscribe to my youtube channel -->
# https://www.youtube.com/channel/UC-sfqidn2fKZslHWnm5qe-A
Text = "python is easy"
print(Text.capitalize())
####output####
Python is easy
xxxxxxxxxx
# 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."
xxxxxxxxxx
x = txt = 'hi this is hussein asadi from iran '
x = txt.capitalize()
print (x)