Posts Python String and inbuilt methods
Post
Cancel

Python String and inbuilt methods

String

Declaring the string

You can declare the string within "" '' Example:

1
2
3
4
>>> a="Hi"
>>> a='Hello'
>>> b="Hi'world'"
>>> c='Hello"world"'

String Methods

str.capitalize()

Returns capitalised string

1
2
>>> "hi".capitalize()
'Hi'

str.capitalize()

Returns capitalised string

1
2
>>> "hi".capitalize()
'Hi'

<<in-progress» Refer : https://docs.python.org/3/library/stdtypes.html


Thanks for reading till end.

Followus on @techpechu

Join Our Discord

We do run a youtube channel in Indian regional language Tamil called TechPechu. Do subscribe us for moral support. Happy Learning.

Follow us on instagram @techpechu