Simple boolean inequality operators mistake

后端 未结 6 604
醉话见心
醉话见心 2020-12-12 01:54

Using inequality operators, I have to define a procedure weekend which takes a string as its input and returns the boolean True if it\'s \'Saturday

6条回答
  •  春和景丽
    2020-12-12 02:28

    The best way to deal with this, use something like this:

    return day.lower() in ['saturday','sunday']
    

提交回复
热议问题