Skip to content

Commit d08bc5c

Browse files
committed
exercise 4
1 parent 8ed16c8 commit d08bc5c

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

3. sys/exercise 4/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Exercise 4
2+
3+
Using the built-in sys module write a script that calculates the sum of the first two arguments.
4+
5+
## Example
6+
7+
```cmd
8+
$ python3 exercise.py 9 11
9+
20
10+
11+
```

3. sys/exercise 4/exercise.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import sys

3. sys/exercise 4/solution.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import sys
2+
3+
if len(sys.argv) > 2:
4+
result = int(sys.argv[1]) + int(sys.argv[2])
5+
print(result)

0 commit comments

Comments
 (0)