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
write advantages and disadvantages of private and public network

QUESTION (i) Define each of the following terms: a) Interlibrary lending b) Manuscript c) Papyrus d) Community profile e) Mauritiana (ii) Explain with example

Conditional statement: An If statement is composed of three parts. The first part should be keyword w.r.t language to convey to the computer that it is if statement. And a Bo

Compiled Language:   An additional program called a compiler translates a program written in a programming language; into a new file that does not require any other program to

Memory access: The use of semi-conductor memory elements (bistables) has been made possible by the use of large scale integrated circuits (LSI) which provide reliability, ease


3. Let f, g: R?R, where g(x) 1 - x + x2 and f (x)=ax + b. If (g ? f )(x)= 9x2 - 9x + 3, determine a, b.

To find the minimum number of shelves in the loading process in cars

THE MICROPROCESSOR The three fundamental units, which comprise a CPU, have now been discussed in general terms.  So too has a microprocessor, because a microprocessor can be de

A magazine publisher based in Nairobi has branch in Kisumu, and one in Mombasa. The company has kept in touch by telephone and courier service. Each office is networked. The networ