The payMe function
Display "What's the most you are willing to pay me for my advice?"
Then prompt the user with...
"The more you pay, the better the answer! (minimum price: $975.46)"
If the user enters a payment of less then that then return False from the function
If the user enters a figure at the minimum or greater, format the number
so that it displays appropriate decimals and commas (e.g. 12,456.45)
and display the following...
"I guess $12,456.45 seems like a fair price"
... return True from the function.
my answer
amount = ""
def payMe():
print("What's the most you are willing to pay me
for my advice?")
amount = input("The more you pay, the better the
answer!" +
"(minimum price: $975.46) ")
amount = float(amount)
if amount >= 975.46:
print("I guess " +
"{:,}".format(amount) , "seems like a fair price")
return True
else:
if amount
<975.46:
print("Go Away!")
return False
now i have to figure out the getTarget() function which i need help with
The getTarget function
The getTarget function must receive the question text
that the user has entered.
You need to set up the code to inspect the question text to
see if it has one of the following key words in it...
Who, What, Where, When, Why, or How
This inspection of the question text must be case-insensitive.
In other words, both "Who" and "who" would be recognized
as matching "Who" in the question text.
If/When you get a match on one of those key words then return
from the function with the first matching key word found.
If there is no match on any of those words, then return
"unknown" from the function.
if more information is needed please let me know
def getTarget():
question = input("want to ask any questions feel free
to ask\n")
question = question.split()
for i in question:
if(i.lower() == "who"):
return i
elif(i.lower() == "what"):
return i
elif(i.lower() == "where"):
return i
elif(i.lower() == "when"):
return i
elif(i.lower() == "how"):
return i
elif(i.lower() == "why"):
return i
return "unknown"
print(getTarget())


If you have any doubts please comment and please don't dislike.
The payMe function Display "What's the most you are willing to pay me for my advice?"...
Can you add code comments where required throughout this Python Program, Guess My Number Program, and describe this program as if you were presenting it to the class. What it does and everything step by step. import random def menu(): #function for getting the user input on what he wants to do print("\n\n1. You guess the number\n2. You type a number and see if the computer can guess it\n3. Exit") while True: #using try-except for the choice will handle the...
What's wrong with my code? : I'm trying to use recursive functions to display and count all the even numbers of an array. However, I can't seem get the program output the number of even integers . Here's the output I want: Here are the 5 even numbers: // Luckily, however, my code does output all the even numbers. But, I also want the program to tell me how may even integers there are. 2 8 14 18 22 MY...
Word Guessing Game Assignment Help Needed. This C++ (I'm using Visual Studio 2015) assignment is actually kind of confusing to me. I keep getting lost in all of the words even though these are supposed to instruct me as to how to do this. Can I please get some help as to where to start? Word guessing game: Overview: Create a game in which the user has a set number of tries to correctly guess a word. I highly recommend...
Using Python, if you could help me with the code # Create a modified version of the search linear function defined # above to return all # occurrences of the search word in the text # An occurrence is the index of a word in the text that matches your given # search string. # e.g. if "hatter" occurs at positions 0, 6, 12 then return [ 0, 6, 12] def search_linear_occurrences(xs, target): """ Find and return a list of...
Interpersonal Communication Subject! Advice Column Assignment - Guidelines If you’ve perused a newspaper before, you’re probably familiar with the various advice columnists (“Dear Abby” comes to mind) who help out distraught individuals in managing any number of interpersonal crises in his/her life. This assignment is divided into two parts: One where you'll be assuming the role of the letter writer who presents the problem, and another where you'll play the role of the actual advice columnist and respond to letters....
Using Python, if you could help me with the code # Create a modified version of the search linear function defined # above to return all # occurrences of the search word in the text # An occurrence is the index of a word in the text that matches your given # search string. # e.g. if "hatter" occurs at positions 0, 6, 12 then return [ 0, 6, 12] def search_linear_occurrences(xs, target): """ Find and return a list of...
This question relates to Javascript. Could you please show me why my code is not working? I want to create 2 text boxes and have the user enter something into both of them. If the text entered into both boxes is identical the a green message is made visible. If the boxes are different a red message is made visable. Please keep it simple because I am new to javascript. <html> <head> <title></title> <script>...
This question relates to Javascript. Could you please show me why my code is not working? I want to create 2 text boxes and have the user enter something into both of them. If the text entered into both boxes is identical the a green message is made visible. If the boxes are different a red message is made visable. Please keep it simple because I am new to javascript. <html> <head> <title></title> <script>...
For this lab you will write a Java program that plays a simple Guess The Word game. The program will prompt the user to enter the name of a file containing a list of words. These words mustbe stored in an ArrayList, and the program will not know how many words are in the file before it starts putting them in the list. When all of the words have been read from the file, the program randomly chooses one word...
My Python file will not work below and I am not sure why, please help me debug! ********************************* Instructions for program: You’ll use these functions to put together a program that does the following: Gives the user sentences to type, until they type DONE and then the test is over. Counts the number of seconds from when the user begins to when the test is over. Counts and reports: The total number of words the user typed, and how many...