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




message = "Hello world"




string_with_single_quotes = 'value 1'
string_with_double_quotes = "value 2"




isFlag = True



How to access string variables?




message = "Hello"
print(message[0])
print(message[1])
print(message[2])
print(message[3])
print(message[4])





Click to Enlarge


Escape characters in string










message1 = "Hello \n world"
message2 = "Hello \t world"

print ("message1 is :", message1)
print ("message2 is :", message2)





Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Thursday, January 31, 2019
 
Updated On  -  Tuesday, March 26, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250