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