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 trialNgqabutho Moyo
2,538 PointsAm I missing something?
I've created a function 'sys.stdin.read()' that is supposed to capture the name, language and steps arguments. I've tried using lists in 'sys.stdil.read([name, language, steps])' but to no avail
from models import Challenge
import sys
def create_challenge(name, language, steps):
data = sys.stdin.read([name, language, steps])
Challenge['name'] = data[name]
Challenge['language'] = data[language]
Challenge['steps'] = data[steps]
2 Answers
m3shack
Python Development Techdegree Student 279 PointsThis is more of a question than an answer, but could this be part of why things didn't run?
from models import Challenge # could the fact that challenge is capitalized be an issue?
import sys
I am humbly asking / suggesting
Megan Amendola
Treehouse TeacherHi! You don't need sys
the arguments are already being passed in and are accessible inside of your function. The second part is to create a challenge and pass in the values. The steps argument should also have a default of 1.
def create_challenge(name, language, steps=1):
Challenge.create(name=name, language=language, steps=steps)