"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...

1 answer below »









"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 itexactly N times, where N is a whole number between 1 and 5 (1≤N ≤5), without changing the rest of the sentence at all.


Input Specification


The input consists of a single integer N. Similar to the way Codio accepts input, your program will use system arguments passed to the program.


Create a new Python file calledproject3.pyin IDLE.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])


Output Specification


Output on a single line the appropriate sentence with far repeated N times. Your program's output must match the correct answer exactly!



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...


Answered Same DayOct 13, 2021

Answer To: "It is a period of civil war. Rebel programs, striking from a hidden computer, have won their first...

Nithin answered on Oct 14 2021
122 Votes
import sys
timesFar = int(sys.argv[1])
print("A long time ago in a galaxy",end=" ")
for i in rang
e(timesFar):
print("far",end=" ")
print("away...")
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here