Python String Methods Part – 2
Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python
Program 1
# Program related string methods # s="Hello\tFriends\tTata" # s=s.expandtabs(20) # print(s) # s="Java is a simple language and i am learning Java and Java is Good Language" # s=s.replace("Java","Python") # print(s) # s="Python is a simple language and i am learning Python and Python is simple Language" # print(s.rindex("simple")) s="I am from TechVidvan college my college is best in my college all technical course available" # s=s.split("college") # print(s) # s=s.rpartition("college") # print(s) # s="Hello" # s=s.zfill(10) # print(s) s1="a12_345" print(s1.isidentifier())
Your opinion matters
Please write your valuable feedback about DataFlair on Google