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

Brian Wilkes
Brian Wilkes
4,731 Points

Don't know what this is asking for!

i dont know what challenge is...

1 Answer

You are asked to create a python function. Here is an example:

def my_function():
  print("Hello from a function")

The name of the function is create_challenge and it has arguments name, language, and steps with steps optional with a default value of 1. Here is a function two parameters including one with a default:

def my_function(param1, country = "Norway"):
  print("I am from " + country)

The third requirement is within the function create a Challenge from the arguments. Similar code was shown in the previous video with:

Entry.create(content=data)

Give it a try and post your code if you get stuck.