Answered step by step
Verified Expert Solution
Link Copied!

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
1 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
2 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.
3 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.
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 2 Lnai 8725

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448505, 978-3662448502

More Books

Students also viewed these Databases questions