Wednesday, June 24, 2015

Python on the go

Those five points from 'Think Python'  lie the basis of most computer programs. I could not think of simplifying it much more than that.

What has been done so far is to output data  with  print.

There are generally two types of data - words and numbers but in the programming world, words are described by strings or characters while numbers are described by integers, floats etc.  "Hello World!" is a string.

To input a string, use raw_input()

name = raw_input('What is your name?')
print name

The above, stores the input  into a variable called name and then prints the name.

What is stored in a variable,  can be changed in the program.



No comments:

Post a Comment