Question: Create a new Python program called project 4 . py with the same basic functionality as for Project 3 , but this time you'll check

Create a new Python program called project4.py with the same basic functionality as for Project 3, but this time you'll check the user's input before printing the output.
Any value passed to your program that is less than 1 should trigger the exact message, "The Universe is vast your view is too small."
Any value passed to your program that is greater than 5 will trigger the message, "Enough already; you're going too far."
If the value passed to your program is between 1 and 5, inclusive, the program runs exactly the same as for Project 3. As a review, here are the specifications from Project 3:
"It is a period of civil war. Rebel programs, striking from a hidden computer, have won their first victory against the evil System Tests."
You might be aware that the events of the Star Wars saga took place a long time ago, in a galaxy that was rather far away. But just how far away was it? We can try to describe it by repeating the word far a certain number of times in the following sentence format:
A long time ago in a galaxy far far away...
In the above example, the word far is repeated twice. However, we'd instead like to repeat it exactly N times, where N is a whole number between 1 and 5(1<=N <=5), without changing the rest of the sentence at all.
Create a new Python file called project4.py. Your file must have this exact name and all letters must be lower case.
It's important to include the following lines at the beginning of your Python file, right after your program documentation:
# include the sys module in this program
import sys
# read the input from the command line
timesFar = int(sys.argv[1])
# the timesFar variable is the value that you'll use for N
Output Specification
Output on a single line the appropriate sentence with far repeated timesFar times. Your program's output must match the correct answer exactly (including spacing and punctuation)!
Sample Input 1: 1
Sample Output 1:
A long time ago in a galaxy far away...
Sample Input 2: 4
Sample Output 2:
A long time ago in a galaxy far far far far away...

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