FLOW OF CONTROL
Q.1 Write a program to print numbers from 1 to 10.
Q.2 Write a program to print numbers from 10 to 1 with the help of a counter variable. Not print statement.
Q.3 Print each character of the string "Python" on a new line using a loop.
Q.4 Print numbers from 1 to 20, but skip multiples of 3 using continue.
Q.5 Write a program that inputs 5 numbers from the user and displays their sum and average.
Q.6 Write a program to calculate the sum of the first 10 natural numbers.
Q.7 Write a program that displays odd numbers from 1 to 100.
Q.8 Write a program that displays the Sum of odd numbers from 1 to 100.
Q.9 Write a program that displays the product of odd numbers from 1 to 100.
Q.10 Write a Python program that asks the user for a word and prints it in a triangle shape using loops.
Q.11 Write a program that inputs a number and then displays the table of the entered no.
Q.12 Write a program that inputs a number and a length, then displays the table.
Q.13 Write a program to find the factorial value of any number entered through the keyboard.
Q.14 Two numbers are entered through the keyboard. Write a program to find the value of one number raised
to the power of another.
Q.15 Ask the user to enter numbers until they type -1, then print the sum of all entered numbers.
Q.16 Reverse a string using a loop (without using slicing).
Q.17 Write a program in Python that counts how many vowels are in a given string.
Q.18 Write a program that enters a number from the user. The program reverses the given integer number and
displays it on the screen.
Q.19 Write a program that enters a number from the user. The program finds the sum of all the digits of this
number and displays the sum on the screen.
Q.20 Write a Python program that finds the largest digit in a given number.
Q.21 Write a program that inputs numbers from your till user enters a negative number. At the end program
calculates the average, sum, maximum, and minimum of all positive numbers.
Q.22 Write a program that accepts no from the user. It checks whether the given number is prime or not.
Q.23 Write a program to enter the numbers till the user wants, and at the end, it should display the count of
positive, negative, and zeros entered.
Q.24 Write a program to enter the numbers till the user wants, and at the end, it should display the maximum
and minimum numbers entered.
Q.25 Write a program to print out whether the entered number is an Armstrong number or not. If the sum of
cubes of each digit of the number is equal to the number itself, then the number is called an Armstrong
number.
For example, 153 = (1 * 1 * 1) + (5 * 5 * 5) + (3 * 3 * 3)
Q.26 Write a program to print out all Armstrong numbers between 1 and 500.
Q.27 Write a program to print the Fibonacci series of n terms, where n is input by the user:
0 1 1 2 3 5 8 13 24....
Q.28 Write a program to calculate the sum of the following series, where n is input by the user.
1 + 1/2 + 1/3 + 1/4 + 1/5 +…………1/n
Q.29 Write a program to calculate the sum of the following series, where n is input by the user.
1 - 1/2 + 1/3 - 1/4 + 1/5 -... 1/n
where n is a positive integer and is input by the user.
Q.30
i) ********** ii) * iii) *
********** ** **
********** *** ***
********** **** ****
***** *****
iv) 1 v) 1 vi) Assignment
12 21
123 321
1234 4321
12345 54321
vii) Assignment viii) A ix) *
AB ***
ABC *****
ABCD *******
ABCDE *********
x) Assignment xi) Assignment xii) Assignment
BBBBBBBBB 1 1
BBBBBBB 222 212
BBBBB 33333 32123
BBB 4444444 4321234
B 555555555 543212345
xiii #.#.#.#. xvi) Assignment xv
.#.#.#.# *****
#.#.#.#.
.#.#.#.# * *
#.#.#.#. * *
.#.#.#.# *****
#.#.#.#.
.#.#.#.#
Q.31 Find the sum of the first five terms of the following series.
Q.32 Find the sum of the first five terms of the following series.
Q.33 Display the prime numbers from 1 to 500.