WARNING: This program has a syntax error, so the program won't run completely until we fix it!

RULE: Use str() to change a variable to a string so that it can be used in string concatenation.

  • Click Run and enter an input for price and discount percentage. What does the error message say?
  • The error says we cannot concatenate 'str' and 'float' objects.
  • Debug this program by converting feet and miles to strings using str().

To navigate the page using the TAB key, first press ESC to exit the code editor.

stage.set_background_color("black") instructions_text = codesters.Text("Enter an amount of feet to convert it to miles!", 0, 180, "yellow") feet = float(stage.ask("Enter an amount of feet."))100 miles = feet / 5280 result_text = codesters.Text(feet + " is " + miles + " miles!", 0, 0, "yellow")
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)