Write a while loop that is functionally equivalent outputs t

Write a while loop that is functionally equivalent (outputs the same thing) as the following for loop: for x in range(56, 120): If (x

Solution

2)5 lines

4) the information required by a function i.e parameters values is shown using a \"black box \" diagram drawn from user perspective
5)- invalid function name ,
no indentation for return statement,
no comma between 2 parameters
6)true
7)loop variable:The loop variable defines the loop index value for each iteration
8)dead code:In computer programming, dead code is a section in the source code of a program which is executed but whose result is never used in any other computation. The execution of dead code wastes computation time and memory.
9) variables do not have scope outside the function because those variables are local to that function.
10)A for loop is just a special kind of while loop, which happens to deal with incrementing a variable. You can emulate a for loop with a whileloop in any language. It\'s just syntactic sugar (except python where for is actually foreach). So no, there is no specific situation where one is better than the other (although for readability reasons you should prefer a for loop when you\'re doing simple incremental loops since most people can easily tell what\'s going on).

3)
import random
count=1
while(count<=5)
n=random.randrange(15,35)
if(n%2==0)
print n,\"\ \"

 Write a while loop that is functionally equivalent (outputs the same thing) as the following for loop: for x in range(56, 120): If (x Solution2)5 lines 4) the

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site