Loops
Print First 10 natural numbers using while loop.
Calculate the sum of all numbers from 1 to a given number.
Write a program to print multiplication table of a given number. eg if number is 2, then output should be 2, 4, 6, 8 ...
Write a program to display only those numbers from a list that satisfy the following conditions
The number must be divisible by five
If the number is greater than 150, then skip it and move to the next number
If the number is greater than 500, then stop the loop given
numbers = [12, 75, 150, 180, 145, 525, 50]
Write a program to count the total number of digits in a number using a while loop. given number
4673453
Display numbers from -10 to -1 using while loop
More Questions for Revision
Write a program to print all the numbers from 1 to 100.
Write a program to print all the numbers from 1 to 100 except multiples of 3.
Write a program to print all alphabets from a to z.
given a list of numbers, write a program to print all the numbers that are divisible by 5 and 7.
using a for loop, create a pattern like this:
Reverse a number using a while loop. given number
12345
, output should be54321
.Find the sum of even numbers using a while loop
Find the factorial of a number using a while loop. Hint: factorial of a number is the product of all the numbers from 1 to n. example number
5
, output should be120
Last updated