- 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;

26th Jun 2018, 4:58 AM
hameed jamal
hameed jamal - avatar
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!
26th Jun 2018, 6:18 AM
Ahri Fox
Ahri Fox - avatar
0
what will be the answer
26th Jun 2018, 4:59 AM
hameed jamal
hameed jamal - avatar