Page 1 of 1

Python

PostPosted: January 15th, 2013, 5:36 pm
by tomtiger11
Python. One of my favourite programming languages. Mainly because of its simplicity. So, Instead of rambling on, here is an example of a counter that counts to ten.

Code: Select all
count = 0
while (count < 11):
   print 'Count:', count
   count = count + 1

print "See ya!"


and here is a simple if statement code:

Code: Select all
i= raw_input("Pi=Tau? (y/n)")
if i == "y":
   print("Nope!")
else:
   print("Correct :D")