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 trialDan Glassman
3,529 PointsGetting error "Couldn't find 'sillycase' "
I think my logic and syntax are good. For some reason the program is not finding my function. Any help is appreciated.
def sillycase(o): c[:] = o h = len(c)//2 f = "".join(c[:h]) s = "".join(c[h:]) m = f.lower() + s.upper() return modified
def sillycase(o):
c[:] = o
h = len(c)//2
f = "".join(c[:h])
s = "".join(c[h:])
m = f.lower() + s.upper()
return modified
1 Answer
Chris Freeman
Treehouse Moderator 68,457 PointsYou have two typos:
-
c[:] = o
should bec = o[:]
- "modified" is not defined, should be
return m
Additionally, it is better programming style to use full variable names as a single character doesn't sufficiently provide meaning to what the variable holds.
Anthony Box
7,435 PointsAnthony Box
7,435 Pointsit looks like you are copying string o into a un-initialized array c. why copy c to o, it's making program a little bulkier. better
also did you mean to for modified to be m?