dimanche 17 juillet 2016

Python3: Syntax for an If statement using a boolean

Hey guys i just recently joined the python3 HypeTrain! However i just wondered how you can use an if statement onto a boolean: Example:

RandomBool = True
#and now how can i check this in an if statement? Like the following:
if RandomBool == True:
    #DoYourThing

And also, can I just switch the value of a boolean like this?

RandomBool1 == True   #Boolean states True
if #AnyThing:
    RandomBool1 = False   #Boolean states False from now on? 

Aucun commentaire:

Enregistrer un commentaire