2 Antworten
+ 2
Strings are most popular types in python. We can create them by enclosing the content within single or double quotation marks.
Example: "Hello" 'World'
Docstrings are enclosed within triple quotation marks
Example: ''' This is an answer '''
str is used to convert to string datatype.
Example: a=7
b=str(a)
print(b)
output >>> '7'
+ 1
str denotes string class in python and it is used to perform all the operations related to the strings like concatenation, length of string, etc.