Use of methods and boolean operations
Course = 'Python for beginners'
print(len(Course)) #print length
print(Course.upper()) # print in capital
print(Course.lower()) # print in lower case # upper and lower are methods
print(Course.replace('beginners','Absolute Beginners')) # replace a word with another
print(Course.find('P')) # to find index of alphabet
print('for' in Course) # boolean operation only comes in true or false
# Here upper is a method
# Len and print are general purpose functions but methods are specifically use for strings
Comments
Post a Comment