Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 800 Bytes

025-python.md

File metadata and controls

40 lines (28 loc) · 800 Bytes

2.5 - Running Programs

Lets create and run a very small python program

#c5f015 Example

  1. Create and "assignments" folder, navigate to it, and create an empty file called hello.py

    cd ~/Development
    mkdir assignments
    cd assignmets
    touch hello.py
    
  2. Put this simple python program into hello.py

    print "Hello, im a python program"
  3. Run hello.py

    pwd
    cd ~/Development/assignments
    python hello.py

#f03c15 Try It

  1. In your assignments folder, create a new python program called "aplusb.py"

    a = 5
    b = 7
    print "The sum of a and b is" + str(a + b)
    
  2. Run this program