Question
This program is in python. We are not allowed "exit()"

In this part, you will write a simple childrens game. You will ask the user to enter five names of friends. Then, you will a
0 0
Add a comment Improve this question Transcribed image text
Answer #1

# Get List of friends

def GetFriendName():

FriendNo=["first", "second","third","fourth","fifth"]

FriendList = []

for i in range(0,5):

FriendList.append( input("Who is the "+FriendNo[i]+" person?") )

return FriendList

def AskQuestions(FriendList):

UsedFriendList = []

person = input("Which of these people would you give your last piece of candy?")

if(person not in FriendList):

print("Hey,I don't know who that is! That's Cheating!")

return

UsedFriendList.append(person)

person = input("With which of these people would you go on a 12 hours road trip?")

if(person not in FriendList):

print("Hey,I don't know who that is! That's Cheating!")

return

UsedFriendList.append(person)

person = input("With which of these people would you play tennis on your yacht?")

if(person not in FriendList):

print("Hey,I don't know who that is! That's Cheating!")

return

UsedFriendList.append(person)

print("I feel bad for these people:")

for person in FriendList:

if(person not in UsedFriendList):

print(person)

# Start Program

AskQuestions( GetFriendName())

File Edit Selection View Go Debug Terminal Help • childrengame.py - python - Visual Studio Code -ox 47 D . childrengame.py •

File Edit Selection View Go Debug Terminal Help • childrengame.py - python - Visual Studio Code - 0 11 X . childrengame.py •

File Edit Selection View Go Debug Terminal Help childrengame.py - python - Visual Studio Code -ox 17 a ... childrengame.py X

File Edit Selection View Go Debug Terminal Help childrengame.py - python - Visual Studio Code -ox childrengame.py X e childre

Add a comment
Know the answer?
Add Answer to:
This program is in python. We are not allowed "exit()" In this part, you will write...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • For each multiple-choice question choose one answer that best answers the question. You must also provide...

    For each multiple-choice question choose one answer that best answers the question. You must also provide your rationale for choosing the answer you did. Based on research on factors that increase informational social influence, which game contestant is most likely to yield to informational social influence provided by teammates or the audience? Joan, playing in the grand prize round of a television game show, who answers a question, whose answer she is uncertain of Jay, playing in the grand prize...

  • Part 1- Additional Resources Allowed The data set to be analyzed in this assignment was collected...

    Part 1- Additional Resources Allowed The data set to be analyzed in this assignment was collected as part of the Stat 216 student projects during a previous semester A survey was conducted at the MSU Library and at Rendezvous Dining Hall. Students passing by were randomly given one of two Facebook status posts, then asked to answer the following questions: 1. How would you best describe the creator of this post: Trustworthy or Untrustworthy 2. What is your major? 3....

  • write like 2 paragraph of what you think of this . Let me start out be...

    write like 2 paragraph of what you think of this . Let me start out be saying that I don't know why people are and have been opposed to the Affordable Health Care Act or more preferably Obamacare. Starting with Medicaid expansion, which was funded 100% by the government in 2014, 2015, and 2016, why would any state elect to optout of Medicaid expansion and leave a portion of their state's population uninsured? Pretty insensitive to the needs of ordinary...

  • EI E 237 Assignment 4: Python Program Due September 18, 2018 Description For this assignment, you...

    EI E 237 Assignment 4: Python Program Due September 18, 2018 Description For this assignment, you will practice several basic Python programming skillis by writing a simple Python 3 program. This program will implement a text-based, 2-player rock-paper-scissors game (if you are unfamiliar with rock-paper-scissors, check out the Wikipedia article The program should give some brief instructions to the players. Next, it should prompt player for a choice, then prompt player 2 for a choice. If a player inputs something...

  • 1. All of the following are reasons that those with dementia may give confusing answers when...

    1. All of the following are reasons that those with dementia may give confusing answers when asked a question EXCEPT: They are confused themselves. They are trying to mislead or lie to you. O They do not know the answer because of their short-term memory loss. They are not sure what you expect of them. 2. Which of the following is an example of helping a person with dementia to have a successful conversation? o I understand you like fly...

  • This program is part 1 of a larger program. Eventually, it will be a complete Flashcard...

    This program is part 1 of a larger program. Eventually, it will be a complete Flashcard game. For this part, the program will Prompt the user for a file that contains the questions – use getline(cin, fname) instead of cin >> fname to read the file name from the user. This will keep you in sync with the user’s input for later in the program The first line is the number of questions (just throw this line away this week)...

  • Python program This assignment requires you to write a single large program. I have broken it...

    Python program This assignment requires you to write a single large program. I have broken it into two parts below as a suggestion for how to approach writing the code. Please turn in one program file. Sentiment Analysis is a Big Data problem which seeks to determine the general attitude of a writer given some text they have written. For instance, we would like to have a program that could look at the text "The film was a breath of...

  • Barcelona Restaurant Group Summary: Barcelona Restaurant Group is always trying to attract and retain only those...

    Barcelona Restaurant Group Summary: Barcelona Restaurant Group is always trying to attract and retain only those employees who reinforce its service-oriented culture and provide top quality customer service. The manager being interviewed in the video is constantly recruiting and hiring new employees and letting low performers and poor fits go. He also tries to provide job candidates with a realistic description of the company's expectations to ensure that they know what they would be getting into if they took a...

  • Write a Java program which will store, manipulate, and print student registration information. As part of...

    Write a Java program which will store, manipulate, and print student registration information. As part of the solution, identify the following classes: Student Admissions. The class Student must have the following fields – Name, Address, Id number, Courses, and Date, where: Name is a user defined class comprising of at minimum first name and last name. Address is a user defined class comprising of fields - street, city, state, and zip code. Date is a predefined class in the java.util...

  • In Real Life: Win-Win Problem Solving [ Silence ] [ Noises ] >> Can you be...

    In Real Life: Win-Win Problem Solving [ Silence ] [ Noises ] >> Can you be a little more quiet? I don't have class until 10 o'clock. I want to catch up on some sleep. >> Sorry to bother you. I am cleaning up last night's dinner dishes. >> Well, I wish you would do it a little more quietly. I was up late studying, >> Well if you would've washed them last night, I wouldn't have had to clean...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT