Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
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(1N55), 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 called project3.py in Thonny. 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 documentatior. The purpose of the and statements are to allow for the input to be passed into the program without requiring a person to type them. Generally. most code doesn't interact with a user directly; there's usually a webpage or mobile app that accepts the user's input and then passes that input into another program. That's what these statements allow your Python script to do. I don't want you to use input statements, at all. The way to get the input to your program is through the two statements, and The variable, timesfor. Will be automatically assigned a value when the program is run. The sys module reads the input of a number between 1 and 5 that is passed to your Python program when you run it. To get this to work in Thonny youtl need arguments. 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... Hints: - In the Week 2 Runestone readings (2.9. String operations) there is an explanation of string operations using + and * - If Gradescope is failing tests, check spelling, check capitalzation, and check spacing between words. Gradescope is comparing your program's output with a test string and it has to match exactly to pass the rest. Rubric: Here is a rubric for this assignment which is worth 25 points toward your projects total grade: 1. Your py file contains appropriate project documentation (your name, course title, basic assignment information, and anything add you may deem appropriate). This documentation must be at the top of your py file before the coding section begins. ( 5 points) 2. Embedded in the code section of your py file, you include appropriate explanatory comments that describe very succinctly what yo. does. (5 points) 3. You include the import and input statements for the input data. (5 points) 4. Your program produces the correct results for the data used to test your program. (10 points)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

5. Explain the supervisors role in safety.

Answered: 1 week ago