Get the App
SLTechnology News&Howtos  ›  Development  › 

How to capitalize the first letter in python

Shulou Source: shulou.com Published: 2022-06-01 05:15:33 10月03日 Update

This article mainly introduces how to achieve the capitalization of the first letter of python, the article introduces in great detail, has a certain reference value, interested friends must read it!

Uppercase first letter

The following code block uses the title () method to capitalize the first letter of each word in the string.

S = "programming is awesome" print (s.title ()) # what are the data types of Programming Is Awesomepython? data types of python: 1. Numeric types, including int (integer), long (long integer), and float (floating point). two。 String, which is of type str and type unicode, respectively. 3. Boolean, Python Boolean is also used for logical operations and has two values: True (true) and False (false). 4. List, the list is the most frequently used data type in Python, and any data type can be placed in the collection. 5. Tuples are identified by "()", and internal elements are separated by commas. 6. A dictionary is a collection of key-value pairs. 7. A collection is an unordered, non-repeating combination of data.

The above is all the content of the article "how to capitalize the first letter in python". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Type data uppercase letter content dictionary character string Boolean article frequent two code value element interest word boy buddy number Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS vpn Shulou Tech Info MySQL Shulou Technology