Articles → Python → Data Types In Python
Data Types In Python
What Are Data Types?
Different Types Of Data
PositiveValue = 25
NegativeValue = -12
PositiveValue = 40000.35
NegativeValue = -40000.35
string_with_single_quotes = 'value 1'
string_with_double_quotes = "value 2"
How To Access String Variables?
message = "Hello"
print(message[0])
print(message[1])
print(message[2])
print(message[3])
print(message[4])
Escape Characters In The String
- \n → Insert a new line between the string
- \t → Insert tab space between the string
message1 = "Hello \n world"
message2 = "Hello \t world"
print ("message1 is :", message1)
print ("message2 is :", message2)