Welcome to the Treehouse Community
Looking to learn something new?
when i write print("hello world") and then on the console i write python hello.py it comes out hello world why not if i write hello_world.py shouldnt that work why only hello.py
Henrik ChristensenPython Web Development Techdegree Student 38,319 Points
Because the file is named hello.py, and for the hello_world.py to work you would need a file named hello_world.py
Steven Parker216,017 Points
It sounds like "hello.py" is the name of the file that contains your code. If you don't also have a file named "hello_world.py", then telling Python to start a file with that name won't do anything.
Regardless of the file name what happens when you run it depends on the code inside the file.
if you want to print the same output hello world, using python hello_world.py command, change the filename hello.py to hello_world.py. Hope this helps.