Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python - how many letters are capital in a string

def n_upper_chars(string):
    return sum(map(str.isupper, string))
Comment

how to make every letter capital in python

my_string = "car"

my_string.upper() # Makes EVERY letter uppercase

print(my_string)

>>> "CAR"



my_string = "car"

my_string.title() # Makes ONLY FIRST letter uppercase and others lowercase

print(my_string)

>>> "Car
Comment

how to make a letter capital in python

s = "hello openGeNus"
t = s.title()
print(t)
PythonCopy
Comment

PREVIOUS NEXT
Code Example
Python :: how to make a nice login django form 
Python :: Code of recursive binary search 
Python :: python substring from end 
Python :: finding the maximum value in a list python 
Python :: length of list python 
Python :: python turtle set screen size 
Python :: login required django 
Python :: python verificar se é numero 
Python :: rename column in pandas with second row 
Python :: split a string into an array of words in python 
Python :: telegram bot webhook python 
Python :: sort and remove duplicates list python 
Python :: adding one element in dictionary python 
Python :: pd.datafram 
Python :: estimate time to run a chunk of code in python 
Python :: how to find lcm of 2 numbers in python 
Python :: set and tuple in python 
Python :: cv2 read rgb image 
Python :: days to int 
Python :: append to pythonpath 
Python :: django convert object to dict 
Python :: how to take two space separated int in python 
Python :: python requests-session for websites with login 
Python :: python webbrowser module 
Python :: maximum element in dataframe row 
Python :: seaborn distplot 
Python :: what is tensor in deep learning 
Python :: make virtual environment wrapper python 3 
Python :: Selecting subset of columns with pandas 
Python :: How to install packages offline? Ask Question 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =