How to Capitalize String in Python?
In this example, I will show you how to capitalize string in python. you can see how to capitalize first letter in python. This tutorial will give you a simple example of python string capitalize example. I explained simply about python string capitalize example. you will do the following things for how to use string capitalize in python.
There is a way to convert a string into capitalizing in python. i will give you one example using capitalize() method to python capitalize first letter of sentence. so let's see the below examples.
You can use these examples with python3 (Python 3) version.
let's see below a simple example with output:
myString = "this is a dog" # String Convert to capitalize capString = myString.capitalize() print(capString);
This is a dog
I hope it can help you...
We are Recommending you
- Python Create an Empty Text File Example
- Python String Convert to Lowercase Example
- Python String Convert to Uppercase Example
- Python List Add Element at Beginning Example
- How to Add Element at the End of List in Python?
- Python Convert List into String with Commas Example
- How to Convert List into String in Python?
- Python Split String into List of Characters Example
- How to Convert String into List in Python?
- Python Remove Empty String from List Example
- Python Post Request with Bearer Token Example
- Python Get First Date of Next Month Example
- Python Create Zip Archive from Directory Example