python statement is
while quantity!=0:
//do something
quantity = quantity-1
Sample Program :

write one python statement to start and possibly continue a while loop while variable quantity does...
Write a Python if statement that calls doWhat() if a and b is true or a and not c is true or e is equal to q. Write an example of a Python for loop that uses a range. Write an example of a Python for loop that iterates on the members of a container such as a list. Show by code example in Python how to concatenate two strings and assign the result to a variable.
s1 = 'Practice How to Use String Object' Write a python statement that splits the string, creating the following list: ['Practice', 'How', 'to', 'Use', 'String', 'Object'] 2. Assume reply references a string. The following if statement determines whether reply is equal to ‘Y’ or ‘y’: reply = input("Y or y to continue: ") if reply == "Y" and reply == "y": print("Y --- <uppercase> has been selected. ") else: print("y --- <lowercase> has been chosen. ") print("… continue...
PYTHON 19. Write one python statement to print the square root of a variable x. Control of decimals not required.
Ex1 In Python Write a while loop that prints out a list containing the first 5 numbers that are multiples of 9 from 1 to 100. (Hint: use break statement) The output should be [9, 18, 27, 36, 45]
Using python, Write a while loop that counts from 1 to 20 by 4s.
PYTHON CODE: Write a program that uses a while loop to examine every integer from 999 down to zero and generate the exact same output as shown blow. The range function is not required. NOTE: you must use a while loop. Required Output 960 920 880 840 800 760 720 680 640 600 560 520 480 440 400 360 320 280 240 200 160 120 80 40
1) Translate the following equation into a Python assignment statement 2) Write Python code that prints PLUS, MINUS, O ZERO, depending on the value stored in a variable named N. 3) What is printed by: 3 - 1 while 5: while 10 Print ) Page 1 of 9 4) Write a Python while loop that reads in integers until the user enters a negative number, then prints the sum of the numbers. 1-2 of 9 4) Write a Python while...
This is in python. I hit a coding block
Create a While Loop that does the following: a = a + -a until it is greater than b. Inside the loop, create a function that adds 10 to a if a = 0. Print the value that makes a greater than b. Make sure the correct answer matches the one listed below. b = 400 444.0892098500626 Saving and Exporting Save your notebook, name the file, download as an HTML file,...
in c++ language 1.Re-write the following for loop statement by using a while loop statement: int sum = 0; for(int i=0;i<=1000;i++){ sum+=i; } 1 (b). Following is the main () function of a program. The program asks a user to enter 150 integers and print the largest integer user entered. int main() { int score, highest; //missing portion of the program return 0; } 1(c). Find the missing portion of the following code, so the...
Using while loop write a python function to find the sum of the negative numbers -3 to -10 but excluding both -3 and -10.