- 1
python question
Fill in the blanks to create a pattern that matches strings that contain 3 characters, out of which the last character is an exclamation mark. r"
quot;2 ответов
+ 6
strings=["Ok!","fox","ba!t"] # list of strings
for s in strings: # for each string
if len(s) == 3: # if string is 3 characters
if s[2] == "!": # if it ends in !
print(True,s)
else:
print(False,s)
else:
print(False,s)
# the instructions were a bit unclear what it meant by match. hopefully this is what you meant.
# next time do your own homework!
0
what will be the answer