Home / Questions / Using the IDLE development environment, create a Python script named tryme4.py..
Waleed Maza
Home
Search coursesSubmitPage path
Programming Assign. Unit 2
The workshop planner displays all phases of the activity and lists the tasks for each phase. The current phase is highlighted and task completion is indicated with a tick.
" data-html="true" tabindex="0" data-trigger="focus" data-original-title="" title="" style="display: inline-block; padding: 6px 18px; margin-top: 5px; margin-bottom: 5px; font-size: 1.08em; line-height: 20px; text-align: center; vertical-align: middle; cursor: pointer; text-shadow: none; border-width: 1px; border-style: solid; border-color: transparent; border-radius: 2px; box-shadow: none; color: rgb(255, 0, 122) !important; background: transparent !important;"></a"no-overflow"">
Workshop timeline with 5 phasesSkip to current tasks
Setup phase
Submission phaseCurrent phase
Assessment phase
Grading evaluation phase
Closed
Instructions for submission
Using IDLE
IDLE is a particular Integrated Development Environment (IDE) that is typically included in a Python installation. An IDE will enable you to use a text editor to create programs (in the case of Python, we refer to the program as a script) as well as execute the program. The IDLE editor understands the syntax of the Python programming language and can help you to debug your program by identifying code that is not valid and must be corrected.
When you first start IDLE, it will display a window that is the Python interpreter. You can type Python commands directly into this environment, and Python will interpret and execute them.
For all of the assignments in this course, you must create a script. To create a script, select "New window" from the "File" menu. This will open a new script file. You can also use the "Open" or "Recent files" options under the "File" menu to open files that you have previously created.
You can enter your script into the window that opens when you use the "New window" option. Before executing your script, you must save it. The first time you attempt to save a new script, you will need to give it a name. All Python scripts must have the suffix of .py on the filename.
To execute a script, you can select the "Run Module" option under the "Run" menu, or optionally press F5 on your keyboard.
Assignment
Using the IDLE development environment, create a Python script named tryme4.py. (Note: an alternative to IDLE is to use a free account on the pythonanywhere website: https://www.pythonanywhere.com/)
IDLE has both an interactive mode and a script mode. You must use the script mode to develop your script. Your script must use meaningful variable names and have comments that describe what is happening in your script. Comments may describe the assignment of a value to a variable, a computation and the assignment of the result to a variable, or the display of the result.
Write a function in this file called nine_lines that uses the function three_lines (provided below) to print a total of nine lines.
Now add a function named clear_screen that uses a combination of the functions nine_lines, three_lines, and new_line (provided below) to print a total of twenty-five lines. The last line of your program should call first nine_lines and then the clear_screen function.
The function three_lines and new_line are defined below so that you can see nested function calls. Also, to make counting “blank” lines visually easier, the print command inside new_line will print a dot at the beginning of the line:
def new_line():
print('.')
def three_lines():
new_line()
new_line()
new_line()
Submit your Python script file in the posting of your assignment. Your Python script should be either a .txt file or a .py file.
You must execute your script and paste the output produced into a document that you will submit along with your Python script.
It is very helpful if you print a placeholder between the printing of 9 lines and the printing of 25 lines. It will make your output easier to read for your peer assessors. A placeholder can be output such as “Printing nine lines” or “Calling clearScreen()”.
The following items will be used in the grading rubric for this assignment. Make sure that you have addressed each item in your assignment.
Apr 02 2020 Read more Less More
Compare countries I and L. Which one of the variables below is the most different between these countries and likely responsible for major differences in these economies?...
May 26 2020How many days after fertilization does the zygote become a ball of cells?a.five daysb.four daysc.one to two daysd.six to eight dayse.it depends on the age of the mother2....
Dec 19 2019A large furnace flue operating at 440C was made from a low-alloy steel. After 2 years in service, specimens were removed from the flue and fracture toughness tests were c...
May 16 2020Find the Laplace transform of the given signals in time by using direct integration. a)u(t)-u(t -1) b) tefu(t) c) (e-2e )u(t) d) cosw cos w:u(t) e) cosh(at )u(t) 1.
Jul 26 2020William Beebe owns a small shoe store. He has 10 pairs of shoes that require resoling and polishing. He has a machine that can resole one pair of shoes at a time, and the...
Jul 27 2020Loneliness is often the result ofa.failing to listen to ourselves and our own feelings.b.feeling apart from others. the death of someone we love. ...
Dec 12 2019A solar flux of 700 W/m2 is incident on a flat-platesolar collector used to heat water. The area of the collector is 3m2, and 90% of the solarradiation passes through the...
May 08 2020~ Exercise 12-12 Volume Trade-Off Decisions (L012-5] . Benoit Company produces three productsA Band Data concerning the three products follower unit Selling price Vari...
Mar 26 2020Which of the following countries has adopted the euro as its currency? A.Great BritainB.FranceC.DenmarkD.SwedenE.Switzerland92.Which of the following is true with regard...
Jan 11 2020The following data were collected during a study of consumer buying patterns:ObservationxyObservationxy1157481878225809147034084101572432811122855519612248864795133390730...
Aug 09 2020Welcome to MyCourseHelp Services, World's leading Academic solutions provider with Millions of Happy Students.