Web | 代做Homework | Assignment | Lab代写 | python代写 – assignment Number 3

Web | 代做Homework | Assignment | Lab代写 | python代写 – 这是一个python进行的web方面的代写任务

homework assignment Number 3

Part 1 Write the following 3 functions

``````1. Write a function that takes a number as a parameter argument. The program should contain a
series of if (and possibly else) statements. It should print different things depending on the
number (as follows):
1. If a number is even, it should print 'even'
2. If a number is odd, it should print 'odd'
3. If a number is divisible by three, it should print 'divisible by three'
4. If a number is zero, it should print 'zero'
5. If multiple statements apply, then multiple print statements should execute. For example, if
the number is six, then 'even' and "divisible by three' should both print.
2. Write a function that takes a number as an argument and returns true if the number meets
Condition 1 or Condition 2 (or both) :
1. Condition 1: The number is even and it is not divisible by 3
2. Condition 2: The number is odd and it is divisible by 3
3. Write a function that queries the user about the truth of a statement and then uses the user's
answers to distinguish between facts, falsehoods, alternative facts, and other categories of
information. The term  alternative facts  was introduced early in 2017 by President Trump's advisor
Kellyanne Conway to characterize false statements that they would like the public to believe to be true.
This was in response to some members of the press pointing out that some of President Trump's
statements could be easily shown to be false and it was odd that he insisted they were true nonetheless.
In addition to its political import, the concept of  alternative facts  raises some interesting questions
for logic. A description of the proposed program follows :
1. Ask the user to choose a statement for evaluation
1. Is the statement is True, False or Unknown according to experts in the relevant domain or
according to some objective set of facts?
2. Is the statement True, False or Unknown according to Donald Trump?
3. Your program should then classify the statements according to the following table using
if/elif/else statements or combinations of these.
Classification Expert Donald
True True True
False False False
Unknown Unknown Unknown
``````
``````Alternative Fact False or Unknown True
Alternative Falsehood True or Unknown False
Alternative Unknown True or False Unknown
4. You have the option of altering the table, to give more fine grained distinctions if you would like.
You can also re-word the questions above to suit your taste. For example, if you are pro-Trump
(or are pretending to be), replace expert in the above table with the left-wing media
conspiracy or something like that. In other words, I am mainly interested in seeing that you
write a good decision-tree program and not that you have a particular political point of view.
``````

Part 2

``````1. Design a program that uses a decision tree
Write out your decision tree and include your plan as either a separate file or a set of comments
2. Write a program that implements this decision tree. The program can be any of the following:
Interactive fiction or other game
A questionnaire that is geared towards solving a particular kind of problem (e.g., choosing a car)
An expert system for solving some problem that you are an expert on
A system for classifying objects (similar to Part 1, Question 2)
Is the topic interesting? Is a decision tree a good way to implement your idea?
Did you have a good plan? Did you implement what you planned?
How many questions are involved? How deep is the tree?
Does the program work?
Did you do anything innovative?
Is your code clear and well-written?
4. Suggestion: Have some plan (do research) before coming to the  lab class and implement during the lab
There has been a lot of previous work done on these sorts of programs. You can find examples on
the  web and try them out.
Interactive fiction
examples in book form (e.g., choose your own adventure series type books)
adventure/role-playing games (both electronic and otherwise)
kids games (e.g., old Humungus Games like "Pajama Sam")
The famous adventure game of 1974 implemented in Python: