Python Strings
Python Strings
Anything between the single or double quotes in python code is considered as ‘strings’ or ‘str’.
A string is just a collection of characters (numbers, alphabets, special char etc) within single or
double quotes.
str
To convert any data point to string , use str(data_point)
number= 1234
The below code will give error as single quoted 1 will not be identified as a numeric value
[email protected]
9T6KVYUXDH'1'+1
o https://docs.python.org/3/library/string.html
o https://docs.python.org/3/library/stdtypes.html#string-methods
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.