重新编码 1:让我们创建一个包含我们已经完成的所有步骤的大型条件。代码看起来很熟悉!

  • , 拖出if到程序的底部。确保它没有缩进!
  • 替换条件选择· == · "yes" : with ( year % 4 == 0 and year % 100 != 0 ):
  • 此条件同时代表condition_1acondition_1b !确保包括括号。
  • ,将Print String拖入if -block 并将其更改为"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
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)