[Tutor] Python help

IDN3 iradn3777 at gmail.com
Thu Aug 13 03:01:12 CEST 2015

To whom it may concern,
    I am having a problem solving the below question.  I have used every
resource that I could find to help me, but I'm seeing nothing.  Can someone
out there please help me understand the below question and learn how to
accomplish this task in Python?  I would really appreciate any help that
someone could afford.

*Problem 1:* Write a program that will calculate the problem and stop after
the condition has been met.

a=number of loops (start with zero)



Condition: If c is less than 5, then the loop will continue; else, it will

3.   *Problem 2:*Print a string variable that states the number of loops
required to meet the condition for Problem 1.

My attempt below.  I used a while loop even though the question is saying
IF/THEN/ELSE.  To my knowledge loops in Python have to be while/for.  Also,
it seems like the question is missing some direction, but I could be
wrong.  Thank you for your help.

a = 0
b = a + 1
c = a + b
while (c < 5):
    c = c + 1

More information about the Tutor mailing list