Question

Using a list help Dr. Pepper investigate a crime. He usually asks 5 questions to each...

Using a list help Dr. Pepper investigate a crime. He usually asks 5 questions to each person he interviews:

  1. "Did you call the victim?"
  2. "Were you in the crime scene?"
  3. "Do you live close to the victim?"
  4. "Did you owe money to the victim?"
  5. "Have you ever worked with the victim?"

The answers are always either "Yes" or "No".

Print the list after you record all the answers.

Your program must give a final verdict about the participation of that person in the crime. If there are 2 positive answers this person must be classified as "Suspect". For 3 or 4 positive answers the classification is "Accomplice", and for 5 positive answers the classification is "Killer". Otherwise, this person should be classified as "Innocent".

For example, if the input is:

For example, if the input is:

No
Yes
Yes
Yes
No

The expected output is:

The recorded answers were ['No', 'Yes', 'Yes', 'Yes', 'No']

The verdict is: Accomplice.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Python code:

code(to copy paste, but maintain above indentation):

print('Answer Yes or No to following questions')
ycount=0
ans=[]
option=input('Did you call the victim?')
if(option=='Yes'):
ycount=ycount+1
ans.append('Yes')
else:
ans.append('No')

option=input('Were you at crime scene?')
if(option=='Yes'):
ycount=ycount+1
ans.append('Yes')
else:
ans.append('No')

option=input('Did you live close to the victim?')
if(option=='Yes'):
ycount=ycount+1
ans.append('Yes')
else:
ans.append('No')

option=input('Did you owe money from the victim?')
if(option=='Yes'):
ycount=ycount+1
ans.append('Yes')
else:
ans.append('No')

option=input('Have you ever worked with the victim?')
if(option=='Yes'):
ycount=ycount+1
ans.append('Yes')
else:
ans.append('No')

print('The recorder answers were:',ans)
if(ycount==2):
print('The vedrict is: Suspect')
elif(ycount==3 or ycount==4):
print('The vedrict is: Accomplice')
elif(ycount==5):
print('The vedrict is: Killer')
else:
print('The vedrict is: Innocent')

output:

Add a comment
Know the answer?
Add Answer to:
Using a list help Dr. Pepper investigate a crime. He usually asks 5 questions to each...
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
  • 4.21 LAB: Detective Work (Python) Using a list help Dr. Pepper investigate a crime. He usually...

    4.21 LAB: Detective Work (Python) Using a list help Dr. Pepper investigate a crime. He usually asks 5 questions to each person he interviews: "Did you call the victim?" "Were you in the crime scene?" "Do you live close to the victim?" "Did you owe money to the victim?" "Have you ever worked with the victim?" The answers are always either "Yes" or "No". Print the list after you record all the answers. Your program must give a final verdict...

  • Multiple-Choice Questions (worth two points each) 1. Which of the following describes the process in which...

    Multiple-Choice Questions (worth two points each) 1. Which of the following describes the process in which one adopts patterns of behavior that lead to greater life satisfaction? A. wellness B. health C. social determination D. self-efficacy 2. The Stages of Change Model of health behavior change emphasizes that A. change happens as a process. B. people change only when faced with an illness. C. change occurs only when the environment supports it. D. changes are more effective when based on...

  • Article Summary I Read the article below and provide feedback by writing a 2 page summary....

    Article Summary I Read the article below and provide feedback by writing a 2 page summary. Please write in essay format (you may include the questions but the response should be in essay format) Must include the following information Title of the article Author(s) of the article Reference list (include the article itself and any other reference material such as another article that is cited in your summary). Use the reference list in the article to get information about another...

  • Please read the article and answer about questions. You and the Law Business and law are...

    Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...

  • First, read the article on "The Delphi Method for Graduate Research." ------ Article is posted below...

    First, read the article on "The Delphi Method for Graduate Research." ------ Article is posted below Include each of the following in your answer (if applicable – explain in a paragraph) Research problem: what do you want to solve using Delphi? Sample: who will participate and why? (answer in 5 -10 sentences) Round one questionnaire: include 5 hypothetical questions you would like to ask Discuss: what are possible outcomes of the findings from your study? Hint: this is the conclusion....

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