The program only works with one client id
<p>Here is a sample of the textfile I use:</p>

<pre><code>NaQua,High
ImKol,Moderate
YoTri,Moderate
RoDen,High
NaThe,Moderate
ReWes,Moderate
BrFre,High
KaDat,High
ViRil,High
TrGeo,High
</code></pre>

<p>For some reason, the program will only work with the last client id on the list. It prints the intensity level but then stops right there as if that's the end of the program.</p>

<pre><code>pie = 'pie'
while pie == 'pie':
f=open('clientIntensity.txt')
lines=f.readlines()
print ((lines[0])[:5])
print ((lines[1])[:5])
print ((lines[2])[:5])
print ((lines[3])[:5])
print ((lines[4])[:5])
print ((lines[5])[:5])
print ((lines[6])[:5])
print ((lines[7])[:5])
print ((lines[8])[:5])
print ((lines[9])[:5])
clientid = input("Please select and input the ID of the client that you would like to record exercise times for. (case sensitive)")
with open('clientIntensity.txt') as f:
    for line in f:
        if clientid in line:
            clientintensity = line[6:]
            print ("The client you have selected has an exercise intensity    of",clientintensity)
            if clientintensity == 'High':
                print ("The exercises for this intensitity level are, Running Swimming Aerobics Football Tennis.")
                while True:
                    try:
                        Running = input("Please enter the amount of time that the client spent running.(0-120 minutes)")
                    except ValueError:
                        print ("Please enter a valid time.")
                        continue
                    else:
                        break
                while True:
                    try:
                        Swimming = input("Please enter the amount of time that the client spent swimming.(0-120 minutes)")
                    except ValueError:
                        print ("Please enter a valid time.")
                        continue
                    else:
                        break
                while True:
                    try:
                        Aerobics = input("Please enter the amount of time that the client spent doing aerobics.(0-120 minutes)")
                    except ValueError:
                        print ("Please enter a valid time.")
                        continue
                    else:
                        break
                while True:
                    try:
                        Football = input("Please enter the amount of time that the client spent playing football.(0-120 minutes)")
                    except ValueError:
                        print ("Please enter a valid time.")
                        continue
                    else:
                        break
                while True:
                    try:
                        Tennis = input("Please enter the amount of time that the client spent playing tennis.(0-120 minutes)")
                    except ValueError:
                        print ("Please enter a valid time.")
                        continue
                    else:
                        break
                totaltime = ((Running)+(Swimming)+(Aerobics)+(Football)+(Tennis))
                print (clientid,"spent a total time of",totaltime,"exercising this week.")


            elif clientintensity == 'Moderate':
                print ("The exercises for this intensitity level are, Walking Hiking Cleaning Skateboarding Basketball")
                while True:
                    try:
                        Walking = input("Please enter the amount of time that the client spent walking.(0-120 minutes)")
                    except ValueError:
                        print ("Please enter a valid time.")
                        continue
                    else:
                        break
                while True:
                    try:
                        Hiking = input("Please enter the amount of time that the client spent hiking.(0-120 minutes)")
                    except ValueError:
                        print ("Please enter a valid time.")
                    continue
                else:
                    break
                while True:
                    try:
                        Cleaning = input("Please enter the amount of time that the client spent cleaning.(0-120 minutes)")
                    except ValueError:
                         print ("Please enter a valid time.")
                         continue
                    else:
                        break
                while True:
                    try:
                        Skateboarding = input("Please enter the amount of time that the client spent skateboarding.(0-120 minutes)")
                    except ValueError:
                        print ("Please enter a valid time.")
                        continue
                    else:
                        break
                while True:
                    try:
                        Basketball = input("Please enter the amount of time that the client spent playing basketball.(0-120 minutes)")
                    except ValueError:
                        print ("Please enter a valid time.")
                        continue
                    else:
                        break
                totaltime = ((Walking)+(Hiking)+(Cleaning)+(Skateboarding)+(Basketball))
                print (clientid,"spent a total time of",totaltime,"exercising this week.")
again = input("Would you like to input times for another client?(Y/N")
if again == 'N':
    pie = 'superpie'
</code></pre>

<p>Change to:</p>

<pre><code>elif 'Moderate' in clientintensity:
</code></pre>

<p>and: </p>

<pre><code>if 'High' in clientintensity:
</code></pre>

<p>as you are using list comprehension (a good tutorial on list comprehension in <em>Python</em> <a href="http://www.pythonforbeginners.com/basics/list-comprehensions-in-python" rel="nofollow">here</a>).</p>

<p>Also, to advance to the next question you need to move your <code>break</code> statements like so:</p>

<pre><code>while True:
    try:
        Running = input("Please enter the amount of time that the client spent running.
        (0-120 minutes)")
        break
    except ValueError:
        print("Please enter a valid time.")
        continue 
while True:
    try:
        Swimming = input("Please enter the amount of time that the client spent swimming.
        (0-120 minutes)")
        break
    except ValueError:
        print("Please enter a valid time.")
        continue
</code></pre>

<p>This way the next question is asked if the user inserts  valid input, (no need for <code>else</code> statements within each <code>while</code> loop).</p>

python