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 Python Basics Functions and Looping Functions

Julieta Dalla Pozza
Julieta Dalla Pozza
4,337 Points

WORKSPACE

Hello, in the workspace provided by treehouse does not work for me. I have created a new file notification.py i run python notification.py and nothing happens! also i tried python3 and nothing. My code seems to be ok dont know why does not work

5 Answers

Are the three lines function calls at the end indented? If so, try un-indenting them to get them out of the yell function.

def yell(text): 
  text = text.upper() 
  number_of_characters = len(text) 
  result = text + "!" * (number_of_characters // 2) 
  print (result)

yell("You are doing great!") 
yell("Dont forget to ask for help!") 
yell("Dont repeat yourself. Keep things Dry")

To use Markdown to format the code in the forums, you can put three backticks (`) and the name of the language (python) on the line before the code block, then put three backticks on the line after the code block. White space matters to Python, and Markdown will preserve spaces.

Have you tried saving the file notification.py before trying to run it? If so, does the file include a print statement?

Julieta Dalla Pozza
Julieta Dalla Pozza
4,337 Points

Yes, i tried that and did not work either :/

I got the same exact issue.

def yell(text): text = text.upper() number_of_characters = len(text) result = text + "!" * (number_of_characters // 2) print (result)

yell("You are doing great!") yell("Dont forget to ask for help!") yell("Dont repeat yourself. Keep things Dry")

I made sure to save it and everything. Also made sure to run my ls -l to see if the file was there. treehouse:~/workspace$ ls -l
total 8

-rw-r--r--. 1 treehouse users 283 Mar 3 17:16 hello.py
-rw-r--r--. 1 treehouse users 268 Mar 3 17:28 notifications.py
treehouse:~/workspace$ python hello.py
treehouse:~/workspace$ python notifications.py
treehouse:~/workspace$ ^C

Robby den Edel
Robby den Edel
217 Points

i have the same issue with the amount of "!" when I do everything correctly.. maybe a bug in the workspace? I don't think it's a big issue as this is a minor thing I believe