Python Assignment-4
Python Assignment-4
1. Write a Python program to find those numbers which are divisible by 7 and multiple of 5,
between 1000 and 2500 (both included).
2. Write a Python program to construct the following pattern, using a while loop.
*
**
***
****
*****
****
***
**
*
3. Write a Python program that accepts a word from the user and reverse it.
4. Write a Python program to count the number of even and odd numbers from a series of
numbers.
Sample numbers: numbers = (1, 2, 3, 4, 5, 6, 7, 8, 9)
Expected Output:
Number of even numbers: 5
Number of odd numbers: 4
5. Write a Python program to get the Fibonacci series between 0 to 50.
Note : The Fibonacci Sequence is the series of numbers :
0, 1, 1, 2, 3, 5, 8, 13, 21, ....
Every next number is found by adding up the two numbers before it.
Expected Output : 1 1 2 3 5 8 13 21 34
6. Write a Python program which iterates the integers from 1 to 50. For multiples of three
print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers
which are multiples of both three and five print "FizzBuzz".
Sample Output :
fizzbuzz
1
2
fizz
4
buzz
7. Write a Python program to find numbers between 100 and 400 (both included) where each
digit of a number is an even number. The numbers obtained should be printed in a comma-
separated sequence.
8. Write a program to find the perfect numbers between 1 and 500.
9. Write a program to find prime number within a range.
10. Write a program to calculate the series (1) + (1+2) + (1+2+3) + (1+2+3+4) + ... +
(1+2+3+4+...+n).
11. Write a program to calculate the value of and then compare the value with Built-in
function.
12. Write a program to find out the sum of an A.P. series.
13. Write a program to find the Sum of GP series.