Introduction: Pi Day | Python Program
As you know already, pi is an endless number often used in math. It is celebrated on 3/14 (March 14th) because the standard use pi is 3.14
Please Note: I am doing this from a Mac, but it also works with extra software for windows. It also works in the Python Shell on the Raspberry Pi.
Step 1: Step 1: Download and Install Textwrangler
Download and install TextWrangler. To do this, go to http://www.barebones.com/products/textwrangler/ and select your computer version. Then download. I recommend that you do it from this website because it is the official one and it prevents the likelihood of virus and malware infections.
Once it is done downloading, open it.
Step 2: Step 2: Create New Python Program
Whether you are into computer programming (for this-python), or not, you just need to copy and paste the following code into a new document.
To Open a New Document: Go to File>New>Text Document
today = raw_input("What is today??") if today == "pi day": print "Yea!!!" time.sleep(2) print "3.14159265358979323846"
This document will not be reading as if it is python till you tell it to. So, save your document. But, before you click save, change the extension (.txt) to .py
This will make it a python program that you can run.
Step 3: Step 3: Run!
Run your program by going to #!>Run in Terminal at the top of the screen. It may take a minute, but it will run your program in Terminal.
First, it will say: What is today?
Respond by typing:
followed by the return key.
It will then say: Yea!!
After that, the program is done
If there is something specific you would like to add, but you do not program, let me know and I can try to elaborate on if for you and send you the code.
If you do program with python and you can make a really cool update to this code, let me know down below and I will definitly respond.
Ask them below and I will respond.
Have a nice day!!
Participated in the
Pi Day Challenge 2016