Please help why am I getting these errors in python, what am I missing?? Function 1: Error: Function 2: Error:

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Please help why am I getting these errors in python, what am I missing?? Function 1: Error: Function 2: Error:

Post by answerhappygod »

Please help why am I getting these errors in python, what am
I missing??
Function 1:
Please Help Why Am I Getting These Errors In Python What Am I Missing Function 1 Error Function 2 Error 1
Please Help Why Am I Getting These Errors In Python What Am I Missing Function 1 Error Function 2 Error 1 (40.25 KiB) Viewed 48 times
Error:
Please Help Why Am I Getting These Errors In Python What Am I Missing Function 1 Error Function 2 Error 2
Please Help Why Am I Getting These Errors In Python What Am I Missing Function 1 Error Function 2 Error 2 (32.86 KiB) Viewed 48 times
Function 2:
Please Help Why Am I Getting These Errors In Python What Am I Missing Function 1 Error Function 2 Error 3
Please Help Why Am I Getting These Errors In Python What Am I Missing Function 1 Error Function 2 Error 3 (12.74 KiB) Viewed 48 times
Error:
Please Help Why Am I Getting These Errors In Python What Am I Missing Function 1 Error Function 2 Error 4
Please Help Why Am I Getting These Errors In Python What Am I Missing Function 1 Error Function 2 Error 4 (29.1 KiB) Viewed 48 times
def get-payment(to_pay: float) -> float: cash_or_card = 11 if float(to_pay) > 100.00: change_amount = "0.00" rounding amount = "-0.00" print("Payment by credit card only.\n") return to pay while (True): cash_or_card = str(input("Pay by cash or credit card: ")).strip().lower() if cash_or_card != "cash" and cash_or_card != "card": continue else: break if cash_or_card == "cash": received = get_cash (to_pay) return received if cash_or_card == "card": change_amount = "0.00" rounding amount = "-0.00" return to_pay

test_get_payment_02 Х EOFError: EOF when reading a line Hide stacktrace File "/tmp/test_krusty.py", line 137, in test_get_payment_62 self.run_get_payment_test(test_num, to_pay) File "/tmp/test_krusty.py", line 117, in run_get_payment_test actual = krusty.get_payment(to_pay) File "/home/krusty.py", line 106, in get_payment cash_or_card = str(input("Pay by cash or credit card: ")).strip().lower() tort got cach?

def get_cash (minimum_cash:int) -> int: cash_value_sum = 8 while True: cash_value = float(input("Enter cash: )) if(not (is_cash(cash_value))): print("Invalid banknote!") continue cash_value_sum = cash_value_sum + cash_value print(f"Payment received: ${cash_value_sum: .2f}") if float(cash_value_sum) >= float(minimum_cash): break return cash_value_sum

v test_get_cash_03 Х ValueError: could not convert string to float: " Hide stacktrace File "/tmp/test_krusty.py", line 184, in test_get_cash_03 self.run_get_cash_test(test_num, to_pay) File "/tmp/test_krusty.py", line 159, in run_get_cash_test actual = krusty.get_cash(minimum_cash) File "/home/krusty.py", line 85, in get_cash cash_value = float(input("Enter cash: "))
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply