word = "Hello World"
print word.count('l') # count how many times l is in the string
print word.find("H") # find the word H in the string
print word.index("World") # find the letters World in the string
print word[0] #get one char of the word
print word[0:1] #get one char of the word (same as above)
print word[0:3] #get the first three char
print word[:3] #get the first three char
print word[-3:] #get the last three char
print word[3:] #get all but the three first char
print word[:-3] #get all but the three last character
print word[:] # a copy of the whole list
print "."* 10 # prints ten dots
print word.split(' ') # Split on whitespace
print word.replace("Hello", "Goodbye")
print word.startswith("H")
print word.endswith("d")
print word.endswith("w")
print word.upper()
print word.lower()
print word.title()
print word.capitalize()
print word.swapcase()
print ":".join(word) # #add a : between every char
print " ".join(word) # add a whitespace between every char
print word.isalnum() #check if all char are numbers
print word.isalpha() #check if all char in the string are alphabetic
print word.isdigit() #test if string contains digits
print word.istitle() #test if string contains title words
print word.isupper() #test if string contains upper case
print word.islower() #test if string contains lower case
print word.isspace() #test if string contains spaces
print word.endswith('d') #test if string endswith a d
print word.startswith('H') #test if string startswith H
s = " Hello "
print s
print s.strip() #removes from both ends
print s.lstrip() #removes leading characters (Left-strip)
print s.rstrip() #removes trailing characters (Right-strip)