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
Submission phaseCurrent phase
Grading evaluation phase
Instructions for submission
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.
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:
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.
Country A has a Gini coefficient of 0.5 and country B has a Gini coefficient of 0.7. It follows thata.there is greater income inequality in country A than B.b.there is gr...Dec 09 2019
Suppose that JB Cos. has a capital structure of 70 percent equity, 30 percent debt, and that its before-tax cost of debt is 11 percent while its cost of equity is 15 perc...Jun 23 2021
How do economic conditions affect a firm’s promotion budget?]Nov 28 2019
A common criticism of GDP as an economic welfare measure is that it excludes _____.Jul 03 2021
Soden, a contractor, made a contract to build a house for Clevert. The sales contract stated that "if either party defaults in the performance of this contract," that par...Aug 04 2021
Arrange the following items in proper balance sheet presentation: (Amounts to be deducted should be indicated with parentheses or a minus sign.) Accumulated depreciation...Apr 15 2020
When heating a solution, a scientist detects a temperature increase in the solution during a period of time. Which of the following statements accurately characterizes th...Jun 08 2020
A researcher collects demographic data on the marital status of the study subjects. the variable is measured as the number of years married on a scale of 0-75. What would...Apr 05 2020
Based on a random sample of 25 units of product X, the average weight is 104 lbs and the sample standard deviation is 10 lbs. We would like to decide if there is enough ...Apr 23 2020
Investigate on the Web the advantages and disadvantages of using a double-acting hammer (air or steam) to drive piles.Jul 19 2020