HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
You can create functions that returns a Boolean Value:
Print the answer of a function:
def myFunction() :
return True
print(myFunction())
You can execute code based on the Boolean answer of a function:
Print "YES!" if the function returns True, otherwise print "NO!":
def myFunction() :
return True
if myFunction():
print("YES!")
else:
print("NO!")
Python also has many built-in functions that returns a boolean value, like the
isinstance()
function, which can be used to determine if an object is of a certain data type:
Check if an object is an integer or not:
x = 200
print(isinstance(x, int))