-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path08.py
More file actions
16 lines (16 loc) · 1.05 KB
/
Copy path08.py
File metadata and controls
16 lines (16 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# mystr = "Anoop is a Good boy"
mystr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
# print(len(mystr))
len(mystr[-1])
# print(mystr[::2])
# print(mystr.isalnum()) # this can detect the space in the string if space present then it print false
# print(mystr.isalpha()) #this can detect all letters in strring are alphabetic or without space
# print(mystr.endswith("boy")) #this can write the last word of the string
# print(mystr.count("o")) #this can count the perticular letter in the string
# print(mystr.capitalize()) # this can capital the first letter of the string
# print(mystr.find("is")) #this can find the letter in the string and write it index
# print(mystr.lower()) # this can convert full string into lowercase
# print(mystr.casefold()) # this can convert full string into lowercase
# print(mystr.upper()) # this can convert full string into uppercase
# print(mystr.replace("is", "are")) #this can replace the letter in the string
# print(mystr.center(30)) # this can center the string by typing the nuber of space you can left