how to assign Values to Variables in python?, Basic Computer Science

ython variables do not comprise to be explicitly declared to already reserve memory space. The declaration occurs automatically when you allocate a value to a variable. The equal sign (=) is used to allocate values to variables.
The operand to the right of the = operator is the value stored in the variable and the operand to the left of the = operator is the name of the variable. for instance:

#!/usr/bin/python

counter = 1000 # An integer assignment
miles = 10000.0 # A floating point
name = "William" # A string

print counter
print miles
Print name
Here 100, 1000.0 and “William " is the values assigned to counter, miles and name variables, in that order. While running this program, this will generate following outcome:
1000
10000.0
William
Posted Date: 5/5/2012 3:36:45 AM | Location : United States







Related Discussions:- how to assign Values to Variables in python?, Assignment Help, Ask Question on how to assign Values to Variables in python?, Get Answer, Expert's Help, how to assign Values to Variables in python? Discussions

Write discussion on how to assign Values to Variables in python?
Your posts are moderated
Related Questions
Digital Camera: A Digital camera is an electronic device which takes video or still photographs or both, digitally by recording images via an electronic image sensor. Digital

i am currently studying my computer science engineering 2nd yr. i am unable to select what specification should i take please help me

Question 1 Define the following terms                           1) Pipelining 2) Super Pipelining 3) Dynamic Execution 4) Multiprocessing 5) Multimedia Extensions Question 2

ENTERPRISE RESOURCE PLANNING What has football got to do with it? asks management guru Michael Hammer in his latest best seller Beyond Reengineering. The answer is almos

what is the sql command to List all the join conditions or join paths (pairwise) existing between tables.

You can also allocate a single value to several variables at the same time. For instance: X=y=z =1 Now, an integer object is generated with the value 1, and all three variables are

draw the e r diagram for irctc rail ticket reservation online

Types of Browsers: Line Mode Browsers : The initial browsers were line mode text browsers. These browsers were simple and used to display text line by line. They used to prov

This is a C file. 1. The program starts by printing your name with an end sign ">". For example, "NAME >"; 2. Then, you can type in a string. If the string is not "vi xxx", you pri

Assignment :  It is composed of variable name, an assignment operator of the language and a value or variable or some expression as per composition allowed based on rules defined