Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Regular Expressions in Python Introduction to Regular Expressions Escapes

Herman Morales
Herman Morales
8,831 Points

first_number() missing 1 required positional argument: 'dato'

i dont know what is the error

escapes.py
import re

def first_number(self, dato):
    print(re.match(r'\d', self.dato))

1 Answer

Jordan Hoover
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jordan Hoover
Python Web Development Techdegree Graduate 59,268 Points

Well, first off, this isn't an object so we don't need to be passing self. That's why you're missing an argument.

Secondly, you need to return, not print, the result.

Finally, you're using the wrong re method.

Not to be rude, but have you taken the beginner python courses? There are a lot of basics things that you are getting wrong here and its always good to refresh.