logo Hurry, Grab up to 30% discount on the entire course
Order Now logo
582 Times Downloaded

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Steven HughesEducation
(5/5)

676 Answers

Hire Me
expert
Craig AndersonEngineering
(5/5)

732 Answers

Hire Me
expert
Georgee BlackbridgeData mining
(5/5)

510 Answers

Hire Me
expert
Bill BattershilllAccounting
(5/5)

894 Answers

Hire Me
Others
(5/5)

Write a program that creates a list of friend names so that these who are Tigers fans are in the beginning of the list.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Write a program that creates a list of friend names so that these who are Tigers fans are in the beginning of the list. These friends who are not should be in the end of the list. The program should run for as long as the user wants to add names.

After the user adds a new name the program should ask if this friend is a Tigers fan. If the the friend is a tigers fan, add the name to the beginning of the list, if not- to the end of the list.

When the user is done adding new names, print the list.

The program should run like this:

Add a new name? Type a name or 'quit' to finish: Vlad Is this person a Tigers fan? y/n n

Add a new name? Type a name or 'quit' to finish: Alice Is this person a Tigers fan? y/n y

Add a new name? Type a name or 'quit' to finish: Bob Is this person a Tigers fan? y/n y

Add a new name? Type a name or 'quit' to finish: Pete

Is this person a Tigers fan? y/n n

Add a new name? Type a name or 'quit' to finish: quit

List of friends, Tigers fans first: ['Bob', 'Alice', 'Vlad', 'Pete']

HINTS:

O. Begin by initializing an empty list of friends like List=[]

1. You will need to set up a while loop.

2. Inside the while loop you need to ask for user input first.

3. Have an if-else condition to decide where to put the name.

 

(5/5)
Attachments:

Expert's Answer

582 Times Downloaded

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme