variable(string)


Introduction
In Python, String variable is value which is character, not numeric as described in numeric variable. The string variable are placed inside the quotation marks"".

Examples
Assignment variable and testing different methods
Here in this sample the declared variable assigned string value and are tested with the string functions which resulted in true or false output. 
 >>> a="Python"
>>> a.islower()
False
>>> a.isdecimal()
False
>>> a.isnumeric()
False
>>> a.startswith("P")
True
>>> a.isprintable()
True

Assigning a list to variable
Here in this sample, the variable is assigned list strings and placed inside the brackets [] and append function is performed which add 2014 in the list.
 >> a=["Python", "Lake", "Learning", "Centre"]
>>> a.append("2014")
>>> a
['Python', 'Lake', 'Learning', 'Centre', '2014']

Getting variable through input()
The input() method declared equal to variable.
 >>> a=input("")
hello
>>> a
'hello'
>>>
>>> b=input('')
You're Python Lake?
>>> b
"You're Python Lake?"
>>>


operator.is_not()
The variable results through operator.is_not:
 >>> x
'Python'
>>> x is not 'python'
True
>>> x is not 'Python'
True



Comments