Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
Python practice starts with ends with
Hi, Iām struggling to find the right regex pattern to do the task: starts with m, ends with e, len 4. Following code works but Iām unable to add the ends with part. I tried adding e$ in some variants to the re.match expression with no success. import re word = input() #your code goes here if len(word) == 4 and re.match(r"^m", word): print ("Match") else: print ("No match")
2 Respostas
+ 3
This should work fine => "^m.{2}equot;
+ 1
thank you. it works and the len... isnāt nessecary anymore too.