Print parameters

Created by Julien Palard

Write a script which prints its own file name.


You should work on this exercise with your own installation of Python, on your computer. Learn how for Mac OSX or Windows.

Have a look at sys.argv.

Don't forget to import the sys module by using import sys.


julien@localhost$ python3
julien@localhost$ mv
julien@localhost$ python

mv is a terminal command (OSX, Linux) renaming or moving a file. For Windows, its equivalent is move.

There's no corrections yet, hit the `Submit` button to send your code to the correction bot.

Keyboard shortcuts:

  • Ctrl-Enter: Send your code to the correction bot.
  • Escape: Get back to the instructions tab.

See solutions