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 Using Databases in Python Gettin' CRUD-y With It CRUD: Create Function

Code Challenge 1: Gettin' CRUD-y with it

Hello all,

Please see my code snippet below. I'm not sure why, but I'm getting the error "create() takes 1 positional argument but 2 were given"

I'm using a tuple but it's counting as 2 arguments.

from models import Challenge

def create_challenge(name, language, steps=1):
  Challenge.create([
      (name),
      (language),
      (steps)
    ])

What am I doing wrong here?

1 Answer

Never mind, all,

I figured this one out. Doesn't need a tuple.

Thanks!