2 String data types

 '''

1. Using string we can store any value but 

it should be in single quotes or double quotes.

2. String is a immutable object


'''

# To define a string variable

# name = 'sri123$#%   &'

# print('name is:', name)

# print('\n memory location for name is :', id(name))


# If string contains double quote 

name1 = " I don't 'know' umamahesh"

print('name is:', name1)

print('\n memory location for name is :', id(name1))

# If string contains double quote 

# name2 = ' I know "sriram"'



# If string contains single quote and double quote 

#name3 = ''' I don't know "sriram"'''


# To update

#name = 'kumar'

#print(name)


# To Delete 

#del name 


# To Print on console

#print(' Name is : ', name)



Comments

Popular posts from this blog

1 PYTHON PROGRAMMING

16 file handling in python

4 Tuple data types