Question: Write a script that takes one number between 1 and 10 from the user as an argumentto the command and checks if a randomly generated

Write a script that takes one number between 1 and 10 from the user as an argumentto the command and checks if a randomly generated number between 1 and 10matches the user supplied number. The program first checks to see if only oneargument has been provided by the user otherwise flags that an error.
$ your_script 5 #will tell you if the computer also generated the same number
$ your_script #will tell you that no args were supplied
You can use $# to check for the number of supplied args.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

code screenshot and output screenshots are attached import random import sys Set our gam... View full answer

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 Programming Questions!