Question about an exercise: Fill in the blanks to create a pattern that matches strings that contain 3 characters | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Question about an exercise: Fill in the blanks to create a pattern that matches strings that contain 3 characters

The exercise says like this: 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. Ok, this is my question: it asks 3 char but wouldn't be the same "--!

quot; to this "..!
quot; ? am i wrong? could someone explain me why?

4th Dec 2018, 10:40 AM
Johanna
Johanna - avatar
4 Answers
+ 4
I have tried --!$ and ..!$ Only the last one works. You can use the sample code to try for yourself. And I checked the python documentation "-" is not a meta character. https://code.sololearn.com/cuHpCaCN9nE4/?ref=app
4th Dec 2018, 1:54 PM
Paul
Paul - avatar
+ 1
Thanks for the reply Paul! i get it now!
4th Dec 2018, 6:19 PM
Johanna
Johanna - avatar
0
..!
19th Dec 2020, 11:04 PM
Kasper Riis Zülow
Kasper Riis Zülow  - avatar
0
..!
21st Jan 2021, 6:34 PM
Syed Fahad Ahmed
Syed Fahad Ahmed - avatar