word = "creative" print(word[4])
word = "creative" word2 = word.capitalize() same = word2[2] == word[len(word) - 1] print(same)
word = "creative" the_sum = word.find("q") + word.find("e") print(the_sum)
word = "cats and dogs and dogs and cats" fyi = 012345678901234567890123456789012 the_sum = word.find("cats", 5) + word.find("dogs", 4) print(the_sum)
word = "" for ltr in "code": word += ltr * 2 print(word)
Use this for the next few problems:
style = "creative"
print(style[2:4])
print(style[:3])
print(style[-2:])
print("eat" in style)
print(style.find("eat"))
print(style.find("it"))
print(style[style.find("e") + 1:])
state = "mississippi" fyi_digits = 01234567890 print(state.rfind("p"))
state = "mississippi" fyi_digits = 01234567890 slicey = state[3:8] print(slicey[2])
state = "mississippi" fyi_digits = 01234567890 print(state[-4:-1][2])
01 def common_ones(word1, word2):
02 if word1 == word2:
03 for i in word1:
04 return new_string
05 new_string += word1[i]
06 for i in range(len(word1)):
07 return new_string
08 new_string += word1[i]
09 new_string = ''
10 if word1[i] == word2[i]:
a
b
c
LE HOOL
school = 'CONCORD-CARLISLE HIGH SCHOOL' fyi_digits = 0123456789012345678901234567 print(school[a:b] + school[c:])
Check.It ©Anthony Beckwith 2019-2024