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 trialRobert Young
1,391 PointsCorrect the import style
I dont see why this is wrong?
import os
import sys
import logging
from re
import match
import search
5 Answers
Travis Howk
7,169 PointsIt should look like this:
import os
import sys
import logging
from re import match
from re import search
For some reason it requires you to have an empty space at the end as well. You also need to specify where you import match and search from.
Megan L
2,905 PointsThis website has helped me with the challenge. pep8online.com/checkresult.
The key to the challenge is that imports must be on their own separate lines. If you are importing from another package or module they can be on the same line. But for this challenge, you need to have a new line afterward. I hope this helps someone with the challenge cause all I was missing was the new line and surprisingly no one posted a solution for this challenge yet.
import os
import sys
import logging
from re import match, search
Lynn Collins
10,080 PointsI'm still NOT getting it!
import os import sys import logging from re import match from re import search
Lynn Collins
10,080 PointsMaybe coding isn't for me
Lynn Collins
10,080 PointsI still don't know how to eliminate whitespaces but somehow I had to play around with it...must be magic or the luck of the draw idk......finally aced challenge
Robert Young
1,391 PointsRobert Young
1,391 Pointsthanks he i must have missed out on what from re is