← Previous Next →

my add

Created by Julien Palard

Instructions

Write a program that print the result of simple addition.

Warning

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

If no parameters are given, you must print the following error message:

usage: python3 solution.py OP1 OP2

Example

julien@localhost$ python3 solution.py 1 2
3
julien@localhost$ python3 solution.py 2 3
5
julien@localhost$ python3 solution.py
usage: python3 solution.py OP1 OP2
julien@localhost$

Hints

To get the parameters given from the command line, you'll need sys.argv.