× Didn't find what you were looking for? Ask a question
Top Posters
Since Sunday
g
3
3
2
J
2
p
2
m
2
h
2
s
2
r
2
d
2
l
2
a
2
New Topic  
DJ DJ
wrote...
Posts: 772
9 years ago
Use a repeat loop rather than a while loop to accomplish the same results as the following program segment. Assume that X will have only integer values. (You may also use an if statement if you like.)

   while (X < 5):
    print(X)
       X = X + 1

This is for my computing programming course
Read 306 times
1 Reply

Related Topics

Replies
wrote...
9 years ago
if (X < 5):
    repeat:
        print(X)
                    X = X + 1
                    until (X = 5)
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  784 People Browsing
 110 Signed Up Today
Related Images
  
 320
  
 325
  
 942
Your Opinion
Which country would you like to visit for its food?
Votes: 204

Previous poll results: How often do you eat-out per week?