Python snippets
From ZENotes
(Difference between revisions)
(Created page with "Hello World #--------------------------------------------------- # This demo program shows off how elegant Python is! # Written by Joe Soap, December 2010. #...") |
|||
| 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. | ||
| + | |||
| + | print(type("Hello, World!")) | ||
| + | print(type(17)) | ||
| + | print("Hello, World") | ||
| + | |||
| + | |||
| + | |||
Back to [[Python]] | Back to [[Python]] | ||
Revision as of 09:51, 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