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)

b=a+1

c=a+b



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



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):
    print(c)
    c = c + 1
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to