Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python: Write a class FootCovering of type object. There are five functions in this class and one variable. The one variable is a list called

Python:

Write a class FootCovering of type object. There are five functions in this class and one variable. The one variable is a list called collection, The five functions are:

__init__ which initializes a collection list variable.

addShoes() which adds shoes to collection

__iter__() starting at the last shoes added to collection

__next__() which moves the index from the last set of shoes added to the first set

shoeShoes() prints collection which uses iter and next to print the shoes in reverse order of being

added to the collection list

Write a class Shoe of type FootCovering. There are three functions in this class and four variables.

The four variables are:

material

size

close (type of closing)

name

The three functions are:

__init__ which initializes material, size, close and name for each shoe

__repr__ which returns shoe information as shown in the example

__str__ which prints shoe information as shown in the example

image text in transcribed

>fc-FootCovering ) >>>-Shoe () >s2-Shoe ('leather',8, slipon, 'Armani') >>>print (s) No name is a Tie shoe size 7 made of leather >>> print (s2) Armani is a slipon shoe size 8 made of leather Shoe (No name, 7, leather, Tie) Shoe (Armani, 8, leather, slipon) >>> fc.addShoes (s) >>> c.addShoes (s2) >fc.collection Shoe (No name, 7, leather, Tie),Shoe(Armani, 8, leather, slipon) >>> fc.showShoes () Armani is a slipon shoe size 8 made of leather No name is a Tie shoe size 7 made of leather

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

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

More Books

Students also viewed these Databases questions

Question

Understanding Group Leadership Culture and Group Leadership

Answered: 1 week ago

Question

Explain the factors that determine the degree of decentralisation

Answered: 1 week ago

Question

What Is acidity?

Answered: 1 week ago

Question

Explain the principles of delegation

Answered: 1 week ago

Question

State the importance of motivation

Answered: 1 week ago

Question

Discuss the various steps involved in the process of planning

Answered: 1 week ago