Knowledge Base‎ > ‎Programming‎ > ‎Python‎ > ‎Python Reference‎ > ‎

split


Related:

 Examples

 
 
age = 16

 Description        

 
Assigns a value to a variable. Creates the variable if it does not exist already.

 Syntax

 
 
name = value

 Parameters

 
name - a legal variable name (must start with a letter, and can have numbers and underscores in them)

value - the value to store in the variable

 Interpreter

 Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55) 

[GCC 4.0.1 (Apple Inc. build 5493)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> age = 16

>>> type(age)

<type 'int'>

>>> age > 10

True

>>> age < 10

False

>>> 




Comments