Question: Write the following statement using while loop. In [ ]: for i in range(10): print(i) In [ ]: # write your code here: i =

 Write the following statement using while loop. In [ ]: for

Write the following statement using while loop. In [ ]: for i in range(10): print(i) In [ ]: # write your code here: i = ? while i # the operation of the for Loop # prevent infinite Loop Q2. (2 points) Using a while loop, create a list numbers that contains the numbers 0 through 35. Your while loop should initialize a counter variable to 0. On each iteration, the loop should append the current value of the counter to the list and the counter should increase by 1. The while loop should stop when the counter is greater than 35 In [ ]: ## write your code here: Q3. (2 points) Write a Python program that prints all the numbers from 0 to 6 except 3 and 6. Note : Use continue statement. Expected Output: 012 45 In [ ]: # write your code here: Q4. (2 points) Write a program that iterates through the list and check whether 100 is in the list or not, if 100 is in the list, it prints it with its index number. i.e.: "There is a 100 at index no: 5" In [ ]: # write your code here and test it on the following list 1st=[10, 99, 98, 85, 45, 59, 65, 66, 76, 12, 35, 13, 100, 80, 95] Q5. (2 points) Write a program to calculate factorial of a number. Factorial of any number n is represented by n! and is equal to 1 x 2 x 3 x ... X(n-1) xn. For instance, 4! = 1 x 2 x 3 x 4 = 24. Also, 1! = 1 and 0! = 1 In [ ]: # write your code. x = int(input() # this is the number entered by the user

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!