The string data types are immutable in python. Immutable means unable to change. So, it cannot be change the value of a string in python. When we are changing the value of a string, a new string will be generated.

Example,

String str=” My name”

Then we are trying to…

Datatypes are the types of data which represents a kind of value. There are many datatypes in python.

Integer

It contains positive or negative whole numbers. Eg, 1, 2, 50, -20, 10

num = 100

print(num)

Output

100

Float

It represents real numbers with floating point. Eg, 2.5, 25.23

fnum = 34.45

print(fnum)

Output

34.45

String

String contains sequence of characters. It represents by using single quotes, double quotes or triple quotes. It is denoted by the class str.

str = “My name”

print(str)

Output

My name

Boolean

Boolean represents True and False values. It is denoted by the class bool.

a = True

type(a)

Output

<class ‘bool’>

The output <class ‘bool’> indicates the variable is a Boolean data type.

The keywords True and False must have an Upper Case first letter. lowercase true and false returns an error.

Python is popular in many areas.

  1. Web development :

It is easy to develop web applications using python, which provide standard libraries to support internet protocols like HTML, XML, JScM, Email processing, FTP & IMAP and has many frameworks like Django and Pyramid, Flask and Bottle, Plone and Django CMS.

Shilpa Sreekumar

Python Developer at TimeClick Software

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store