Question: please using python, thanks! Increment Write a program that reads an integer from command line arguments, increments the number, and writes the result to the
please using python, thanks!
Increment
Write a program that reads an integer from command line arguments, increments the number, and writes the result to the file spam.txt.
If the command line argument cannot be converted to an integer, the program instead writes the message Not a number to the file.
Note: Don't forget to also write a newline character ' ' to the end of the file, after writing the number or message.
Example 1:
$ python increment.py 0 $ cat spam.txt 1 $ ...
Example 2:
$ python increment.py ten $ cat spam.txt Not a number $ ...
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
