Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - If you don't know how to use python?
If you don't know how to use python?
If not in python, the usage is as follows:

The syntax of 1 and if is: if condition is true: execute the statement, and not means no.

2. From the above explanation, it can be understood that if the not condition is true: execute the statement.

3. For example, if n>3: print "True", if n=3, print "True". If you don't add it, that is, if you don't add n>3: Print "true" to indicate: N.

Extended data:

"If not 1" in python:

If conditional statement needs to be followed by bool data, that is, True or False. But if it is not bool data, it can be converted into bool data, and the conversion process is implicit.

In Python, a series of objects representing nothingness and nothingness, such as None, empty list [], empty dictionary {}, empty tuple () and 0, will be converted to False. Everything else will be converted to True.

In the command "If not 1", 1 will be converted to bool type True. Not is a logical operator and not 1 is always false. Therefore, statements under the if statement if not 1 will never be executed.