Question: 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

Python: Write a class FootCovering of type object. There are five functions

>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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!