# Program to solve my Physics Problems for me
print "Welcome to the Physics Problem Solver"
print "-------------------------------------"
print "    by Chris Loyd  6 July 2001       "
print
print
print "This program keeps loyal to the M.K.S. system"
print
print "If you do not know know what M.K.S. stands for, then you should not be using"
print   "this program"
print
print "Please select whatever it is that you want to find"
print
print "1  Displacement"
print "2  Average Velocity"
print "3  Average Acceleration"
print
problem = input("> ")
print
if problem == 1:
    a = input("What is the initial position?  ")
    b = input("What is the final position?  ")
    displacement = b-a
    print "The displacement is", displacement, "meters."
elif problem == 2:
    print "1  Press if you know the Displacement"
    print "2  Press if you know the Change in Time"
    print "3  Press if you know both"
    print "4  Press if you know neither"
    problem2 = input("> ")
    if problem2 == 1:
        a = input("What is the Displacement?  ")
        b = input("What is the initial time?  ")
        c = input("What is the final time?  ")
        averagevelocity = a/(c-b)
        print "The average velocity is", averagevelocity, "meters per second."
    elif problem2 == 2:
        a = input("What is the inital position?  ")
        b = input("What is the final position?  ")
        c = input("What is the change in time?  ")
        averagevelocity = (b-a)/c
        print "The average velocity is", averagevelocity, "meters per second."
    elif problem2 == 3:
        a = input("What is the Displacement?  ")
        b = input("What is the change in time?  ")
        averagevelocity = a/b
        print "The average velocity is", averagevelocity, "meters per second."
    else:
        a = input("What is the initial position?"  )
        b = input("What is the final position?  ")
        c = input("What is the initial time?  ")
        d = input("What is the final time?  ")
        averagevelocity = (b-a)/(d-c)
        print "The average velocity is", averagevelocity, "meters per second."
elif problem == 3:
    print "1  Press if you know the change in velocity AND the change in time"
    print "2  Press if you know JUST the change in velocity"
    print "3  Press if you know JUST the change in time"
    print "4  Press if you know none of these factors"
    problem3 = input("> ")
    if problem3 == 1:
        a = input("What is the change in velocity?  ")
        b = input("What is the change in time?  ")
        acceleration = a/b
        print "The average acceleration is", acceleration, "meters per second per second."
    elif problem3 == 2:
        a = input("What is the change in velocity?  ")
        b = input("What is the initial time?  ")
        c = input("What is the final time?  ")
        acceleration = a/(b-c)
        print "The average acceleration is", acceleration, "meters per second per second."
    elif problem3 == 3:
        print "1  Press if you know the Displacements"
        print "2  Press if you know the Changes in Time"
        print "3  Press if you know both"
        print "4  Press if you know neither"
        problem3_1 = input("> ")
        if problem3_1 == 1:
            a = input("What is the first Displacement?  ")
            b = input("What is the initial time for the first displacement?  ")
            c = input("What is the final time for the first displacement?  ")
            averagevelocity1 = a/(c-b)
            print "The initial average velocity is", averagevelocity1, "meters per second."
            d = input("What is the second Displacement?  ")
            e = input("What is the initial time for the second displacment?  ")
            f = input("What is the final time for the second displacement?  ")
            averagevelocity2 = d/(f-e)
            print "The final average velocity is", averagevelocity2, "meters per second."
            g = input("What is the change in time for the average velocity?  ")
            acceleration = (averagevelocity2-averagevelocity1)/g
            print "The average acceleration is", acceleration, "meters per second per second."
        if problem3_1 == 2:
            a = input("What is the first initial position?  ")
            b = input("What is the first final position?  ")
            displacement1 = b-a
            print "The first displacement is", displacement1, "meters."
            c = input("What is the change in time for the first displacement?  ")
            velocity1 = displacment1/c
            print "The initial average velocity is", velocity1, "meters per second."
            d = input("What is the second initial position?  ")
Python Projects
Look at it.  Laugh at it.  Tell me how I can make this program shorter.  Please.