Python snippets

From ZENotes
(Difference between revisions)
Jump to: navigation, search
Line 9: Line 9:
 
     print("Hello, World!")    # Isn't this easy!
 
     print("Hello, World!")    # Isn't this easy!
 
      
 
      
 +
  
 
If you are not sure what class a value falls into, Python has a function called '''type''' which can tell you.
 
If you are not sure what class a value falls into, Python has a function called '''type''' which can tell you.

Revision as of 09:57, 1 May 2013

Hello World

   #---------------------------------------------------
   # This demo program shows off how elegant Python is!    
   # Written by Joe Soap, December 2010.
   # Anyone may freely copy or modify this program.
   #---------------------------------------------------
   
   print("Hello, World!")     # Isn't this easy!
   


If you are not sure what class a value falls into, Python has a function called type which can tell you.

   print(type("Hello, World!"))
   print(type(17))
   print("Hello, World")
   


Back to Python

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox