Range() doesn't work

Hi there,
May I know why the range() function doesn’t work in #308-1 ?

Screen Link:
Learn To Measure Variability | Dataquest

My Code:

for year in range(min(houses['Yr Sold']), max(houses['Yr Sold'])):
    print (year)

What I expected to happen:

2006
2007
2008
2009
2010

What actually happened:

TypeError: range() takes 1 positional argument but 2 were given

I also tried the range examples in Built-in Types — Python 3.9.7 documentation, all of them don’t work at the same time.

I tried running your code above in that lesson and it runs without any errors. Is that the entire code? What’s the complete error you get?

Hey doctor, it’s nice to see you again.
I figure out that I created a function named ‘range’, therefore it replace the built-in one.

Thank you and have a nice day :slight_smile:

1 Like