Python tutorial for Beginners - Learn Python on Your own - tutorial-3. Strings and Booleans

In this blog we will go through the topics on boalean and strings in python and how to use them..

booleans and strings.

In this blog we will go through the topics on booleans and strings in python and how to use them. So, lets get started.

Boolean :

It is a datatype which takes only two values i.e, either True or False. The result of any Evaluated expression will be a boolean.

Its mostly used in conditional statements.

examples:

a = True
b = False

print(a , b )
print( type(a),type(b) )

Output:

True False
<class 'bool'> <class 'bool'>

In python the comparasion operator is almost same as used in maths but only equals to is represented by == and not equals to as !=

examples:

a = 5
b = 12

# compare a and b.
print(a<b)
print(type(a<b))

Output:

True
<class 'bool'>

As we all now the result will be true in maths that is same as python, Any comparsion operation in python results a boolean. similarly it will result for

Did you like it? Why don't you try also...

What is Http

In this blog we will learn about what is http and how its used on internet.

Python tutorial for Beginners - Learn Python on Your own - tutorial-2. Variable and Datatypes

In this blog we will go through the topics on variable and datatypes in python and how to use them..

Python tutorial for Beginners - Learn Python on Your own - tutorial-1. Introduction

Learn step by step the basics of the Python for newbies.