0

Not printing function

def computeRate(numDays, plan): if plan == 'A': return numDays * 169 elif plan == 'C': return numDays * 112 else: return numDays * 99.99 if __name__ == '__main__': rate = 0.0 dayString = input('How many days do you plan to stay? ') days = int(dayString) question = input('Do you want a meal plan? Y or N') plan = '' if question == 'Y': plan = input('Enter your plan type: ') print('Total rate is $%.2f' % computeRate(days, plan)) print(computeRate)

3rd May 2020, 5:56 AM
Christian Sandoval
Christian Sandoval - avatar
9 Antworten
+ 1
Cengage mindtap
3rd May 2020, 6:08 AM
Christian Sandoval
Christian Sandoval - avatar
0
If the code is A, three meals per day are included, and the price is $169.00 per day. If the code is C, breakfast is included, and the price is $112.00 per day. All other codes are invalid.
3rd May 2020, 5:58 AM
Christian Sandoval
Christian Sandoval - avatar
0
This is the error i get E ====================================================================== ERROR: test_unit_test (__main__.UnitTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/root/sandbox9ed53719/nt-test-9223cee5.py", line 5, in test_unit_test self.assertTrue(computeRate(3) > 299, msg='[FAILED]') TypeError: computeRate() missing 1 required positional argument: 'plan' ---------------------------------------------------------------------- Ran 1 test in 0.001s FAILED (errors=1) Test Contents
3rd May 2020, 6:06 AM
Christian Sandoval
Christian Sandoval - avatar