Answers for "python string find method"

0

python string find

The find() method returns the index of first occurrence of the substring
(if found). If not found, it returns -1.
message = 'Python is a fun programming language'

# check the index of 'fun'
print(message.find('fun'))

# Output: 12
Posted by: Guest on September-13-2021
0

python string upper method

str1 = "HeLlO_wOrLd!"
str1.upper()
Output: 'HELLO_WORLD!'
Posted by: Guest on January-13-2022

Python Answers by Framework

Browse Popular Code Answers by Language