Answer:
punctuation_chars = ["'", '"', ",", ".", "!", ":", ";", '#', '@']
def strip_punctuation(strWord):
for charPunct in punctuation_chars:
strWord = strWord.replace(charPunct, "")
return strWord
Explanation:
The function is defined with a single argument.
A for loop is ran to check each character of the the word.
If a punction mark is present as a character in the word, it is removed.
The same word is returned but without the punctuation marks.
Nope. You're on your own to find them and fix them. This why testing is so important, otherwise they won't show up until the customer finds them and that's embarrasing.
Answer:
Please see the full code in explanation
Explanation:
#This is a console program
def bill_calculator():
print("Enter the Total value of the bill:\n")
bill_total = float(input())
print("Enter total number of dinners:\n")
total_dinner = int(input())
bill_per_person = bill_total / total_dinner
result = ("Bill total: {} \n"
"Total dinners: {} \n"
"Bill per person: {} ").format(bill_total,total_dinner, bill_per_person)
print(result)
if __name__ == '__main__':
bill_calculator()
I believe the answers are:
3. B
4. D