Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need help with this problem. I am lost on the coding in some spots. program that asks for names and some attribute of the

i need help with this problem. I am lost on the coding in some spots.

program that asks for names and some attribute of the item (see below). Use a WHILE loop to continue to get input. When the user is finished entering information, display some arithmetic information about what they entered.

Lets say i wanted to use different sports as a category, can i use the list function to make a list of sport types and then use elifs to create a ttributes for each? Also, i have to keep track of the input so i can perform arithmetic at the end. Please help

here is an example:

Enter a fruit: apple

What color is it (R)ed, (Y)ellow, (O)ther? R

Do you want to add more (Y/N)? Y

Enter a fruit: banana

What color is it (R)ed, (Y)ellow, (O)ther? Y

Do you want to add more (Y/N)? Y

Enter a fruit: cherry

What color is it (R)ed, (Y)ellow, (O)ther? R

Do you want to add more (Y/N)? Y

Enter a fruit: grape

What color is it (R)ed, (Y)ellow, (O)ther? O

Do you want to add more (Y/N)? N

You entered 4 altogether.

There were 2 red fruits.

There were 1 yellow fruits.

There were 1 fruits that were neither red nor yellow.

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

Students also viewed these Programming questions

Question

1. How do most insects respire ?

Answered: 1 week ago

Question

Who is known as the father of the indian constitution?

Answered: 1 week ago

Question

1.explain evaporation ?

Answered: 1 week ago