I may get a potential bug


#1
def rental_car_cost(days): 
  rental =  days * 40
    if days >=  7:
      rental -=  50
    elif days >=  3:
      rental -= 20
    return rental

This is my solution, when I click run button, it takes a very long time to process,refreshing the page won’t work this time. Moreover, it shows a very long error message just after I click the run button.here is the error message.
Traceback (most recent call last):
File “/var/codecademy/codex/runners/python/cli_runner.py”, line 152, in
CLIRunner().start()
File “/var/codecademy/codex/runners/python/base_runner.py”, line 46, in start
self.handle_command(command, code)
File “/var/codecademy/codex/runners/python/cli_runner.py”, line 77, in handle_command
res = self.execute(code, self.run_globals)
File “/var/codecademy/codex/runners/python/cli_runner.py”, line 119, in execute
runner_io.stderr.write(’’.join(list))
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xef in position 23: ordinal not in range(128)


#2

here:

def rental_car_cost(days): 

the ( you are using is not a valid unicode character, which the error message is telling you:

UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xef in position 23


#3

:sweat_smile: Yes! Thanks, but during that period,I really cannot figure it out by myself.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.