小编Luc*_*ity的帖子

使用布尔值的If语句的语法

嘿伙计们,我刚刚加入了python3 HypeTrain!但是我只是想知道如何在布尔值上使用if语句:示例:

RandomBool = True
#and now how can i check this in an if statement? Like the following:
if RandomBool == True:
    #DoYourThing
Run Code Online (Sandbox Code Playgroud)

而且,我可以像这样切换一个布尔值吗?

RandomBool1 == True   #Boolean states True
if #AnyThing:
    RandomBool1 = False   #Boolean states False from now on? 
Run Code Online (Sandbox Code Playgroud)

python if-statement boolean python-3.x

7
推荐指数
2
解决办法
9万
查看次数

标签 统计

boolean ×1

if-statement ×1

python ×1

python-3.x ×1