Python Questionnaire

User Generated

WNFBA99

Computer Science

Description

Unformatted Attachment Preview

Alice, Bob, Charlie, David, and Eve are friends trying to decide whether to go skiing or study next weekend. Each casts a vote. Let their votes be denoted by predicates a, b, c, d, and e where each is True if the preference is for skiing, and False if the preference is for studying. Write a python formula (using and, or, not, and parentheses no "if” statements or other Python operators allowed that is False if the majority wants to ski, and True if the majority wants to study. Note that you can break long lines in Python with a backslash. hint: Do not make a function. The answer should be a single expression using variables a, b, c, d and e, plus operators and, or and not. Example: (a or bor c) and (a or bor d) 1 (a and b and c) or (a and b and d) or (b and c and d)\ or (a and c and d) or (a and b and e) or (a and c and e) \ or (a and d and e) or (b and c and e) or (b and d and e) 4 N m n N 000
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

There it is 😉

not((a and b and c) or (a...

Similar Content

Related Tags