Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


HPR0282: Python Programming 101: Part 2

Hosted by Xoke on 2009-01-28 00:00:00
Download or Listen

print ("Hello World")

print ("Hello \"World")

x = 1
print (x)

x = 1
x = x + 5
x = x * 7
print (x)

x = 1 + 5 * 7
print (x)

x = (1 + 5) * 7
print (x)

# This is a comment
x = (1 + 5) * 7
# print ("5")
print (x)

x = "Hello World"
print (x)

x = "Hello"
y = "World"
print (x+y)

x = "Hello"
y = "World"
print (x + " " + y)

sFirstName = "John"
sSurname = "Smith"
print ("Dear " + sFirstName + " " + sSurname)

x = 13
sFirstName = "John"
sSurname = "Smith"
if x < 12:
	print ("Good Morning " + sFirstName + " " + sSurname)
else:
	print ("Good Evening " + sFirstName + " " + sSurname)

x = 11
sFirstName = "John"
sSurname = "Smith"
if x < 12:
	print ("Good Morning " + sFirstName + " " + sSurname)
else:
	print ("Good Evening " + sFirstName + " " + sSurname)
print ("When does this get printed?")

Comments



More Information...


Copyright Information

Unless otherwise stated, our shows are released under a Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.

The HPR Website Design is released to the Public Domain.