Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In shapes . py write a series of functions, each of which builds a data structure of some sort; we've drawn the picture for each
In shapes py write a series of functions, each of which builds a data structure
of some sort; we've drawn the picture for each data structure below. Some of the functions take one or more parameters; in that case, drop the values into
the functions take one or more parameters; in that case, drop the values into the data structure at the proper location. You should not do anything to thesc
parameters other than putting them in the proper locations; you know nothing
about what they contain.
NOTE: All of the rectangles in these pictures represent Python lists that is
arrays Do not attempt to use tuples, classes, or any other type.
NOTE: Notice that some of these functions take parameters. Those that take
parameters will put those parameters at specific locations within the shape that,
you must generate.Computer Programming II
Restrictions
Do not use any of the following Python features in your code:
import of libraries except if explicitly allowed
List comprehensions
Generators
Type annotations
with open Explicitly open and close the file instead
Ternary operator
Recursion until we study it
Lambda expressions
Nested functions
Closures
Overview
In this project, you will be practicing with reading and creating reference di
agrams. First, we will give you a series of reference diagrams, and you will
produce a function to build each one; some of the functions will have parame
ters, while others will not.
Second, we will give you a few snippets of code, and you will draw the
reference diagram for each; in some cases, you will simply produce a reference
diagram for the final state, but in others you will produce multiple diagrams,
to represent various steps in the process.
Background A File of Functions???
We all have seen that we can write a program inside a Python file; we define
the main function, and then we call it ourselves.
But another important skill for a programmer is the ability to write a func
tion which will be utilized in somebody else's program. In this case, you define a
file, and define functions inside of it but you do not call the function yourself.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started