Monday, July 8, 2019

Python String Variable Demonstration

Python String Variable Demonstration







# Python String Variable Demonstration

# Declaration

#String Declaration with a single quote for single line display
x= ''
print (x)

#String Declaration with a double quote for single line display
x= "    "
print (x)

#String Declaration with multi-line print with a single quote
x = '''Hello
This is Python Multiline
demo
'''
print (x)


#String Declaration with multi-line print with double quote
x = """Hello
This is Python Multiline
demo
"""
print (x)

#How print works
x= 'hello'
#variable will be printed
print (x)

#x as a string will be printed
print ('x')

#x as a string will be printed
print ("x")

#variable x will be printed in string conversation
print (str(x))

#repr()  representation that has all information
print (repr(x))

4 comments:

Wireless Security Configuration: Protect Your Network Now!

Introduction: In today’s connected world, wireless networks are as common as smartphones, and they’re often the gateway to our personal, pr...