RECODE 1: Let's create one large conditional that includes all the steps we already did. The code will look familiar!

  • From , drag out if to the bottom of your program. Make sure it's not indented!
  • Replace the condition choice·==·"yes": with (year % 4 == 0 and year % 100 != 0):
  • This condition represents both condition_1a and condition_1b! Make sure to include the parentheses.
  • From , drag Print String in the if-block and change it to say "That is a leap year!"

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

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)