1. 学习
  2. /
  3. 课程
  4. /
  5. Data Types in Python

Connected

练习

More than just true and false

Python has two boolean values available for you to use: True and False. Most commonly these boolean values are used to indicate that something is on or off, yes or no, or similar states. Additionally, many python types return "truthy" or "falsey" values depending on their condition when evaluated using the bool() function.

说明

100 XP
  • Create an empty list called my_list
  • Print the truthiness of my_list.
  • Append the string 'cookies' to my_list
  • Print the truthiness of my_list.