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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!