Basic Printing in Python

From OpenCircuits
Jump to: navigation, search

1

By now you probably know how to print "Hello World"

   print "Hello World"

But what about printing other things? How would you print the number 5? Actually there are 2 ways with results that look the same but have an important difference:


   print "5"
   print 5

So what is the difference? "5" is not a number it is a string ( or text or words..... ) where as 5 is a number, in particular an integer, just a bit different from 5. which is also a number, but is a floating point number.


You Might Also Be Interested In

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox