Using python, Write a while loop that counts from 1 to 20 by 4s.
i=0 #loop control variable
while(i<20):#runs from 1 to 20
i+=4#incrementing by 4
print(i,end=" ")
output:
4 8 12 16 20

Using C++ 1. Create a while loop that counts even numbers from 2 to 10 2. Create a for loop that counts by five (i.e. 0, 5, 10, ...) from 0 to 100 3. Ask for a person's age and give them three tries to give you a correct age (between 0 and 100) 4. Use a for loop to list Celsius and Fahrenheit temperatures. The "C" should be from -20 to 20 and the F should be shown correspondingly...
Using while loop write a python function to find the sum of the negative numbers -3 to -10 but excluding both -3 and -10.
Can someone please rewrite this code using a while loop? Please write it in python. #The winning number my_number = 12 #variable for the input name user_n = input("Hello! What is your name?") #Ask the user print("Well",user_n,": I am thinking of a number between 1 and 20." + "Take a guess.") user_n = float(input("Take a guess.")) #if statements if user_n == my_number: print("Good job" ,user_n, "You guessed my number!") if user_n > my_number: print("Your guess is high. You lose.") if...
Python problem using a while loop (not a for loop) TASK 2: A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and federal sales tax collected. The Company made $1000 in sales in month 1. Sales increased by 10% from the previous month each month for 6 months except in month 5 where it increased only 7%. (i.e. From month 5 to month 6 there was only...
in Linux, BASH Shell Write a while loop script called count that counts and prints the numbers 0 thru 9 without issuing a new line after each output.
Python Prompt the user to enter a step size to step down by. Write a while loop iterates from 30 down to 0 is step size as input. Prompt the user to enter a step size to step down by. Write a for loop iterates from 30 down to 0 is step size as input.
write one python statement to start and possibly continue a while loop while variable quantity does not equal zero
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
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]
Question 1 - while .. else loop Write a Python program to create the multiplication table (from 1 to 12) of a number that is given by the user. Example: User keyed in number 5 Output: Multiplication Table for 5 1 x 5 = 5 2 x 5 = 10 . . . 10 x 5 = 50 11 x 5 = 55 12 x 5 = 60