Special
Special
Write a Python program to find those numbers which are divisible by 7 and
multiples of 5, between 1500 and 2700 (both included).
Click me to see the sample solution
4. Write a Python program to construct the following pattern, using a nested for
loop.
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*
Click me to see the sample solution
5. Write a Python program that accepts a word from the user and reverses it.
Click me to see the sample solution
6. Write a Python program to count the number of even and odd numbers in 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
Click me to see the sample solution
7. Write a Python program that prints each item and its corresponding type from
the following list.
Sample List : datalist = [1452, 11.23, 1+2j, True, 'w3resource', (0, -1), [5, 12],
{"class":'V', "section":'A'}]
Click me to see the sample solution
8. Write a Python program that prints all the numbers from 0 to 6 except 3 and 6.
Note : Use 'continue' statement.
Expected Output : 0 1 2 4 5
Click me to see the sample solution
9. Write a Python program to get the Fibonacci series between 0 and 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
Click me to see the sample solution
10. Write a Python program that iterates the integers from 1 to 50. For multiples
of three print "Fizz" instead of the number and for multiples of five print "Buzz".
For numbers that are multiples of three and five, print "FizzBuzz".
Sample Output :
fizzbuzz
1
2
fizz
4
buzz
Click me to see the sample solution
11. Write a Python program that takes two digits m (row) and n (column) as input
and generates a two-dimensional array. The element value in the i-th row and j-th
column of the array should be i*j.
Note :
i = 0,1.., m-1
j = 0,1, n-1.
12. Write a Python program that accepts a sequence of lines (blank line to
terminate) as input and prints the lines as output (all characters in lower case).
Click me to see the sample solution
13. Write a Python program that accepts a sequence of comma separated 4 digit
binary numbers as its input. The program will print the numbers that are divisible
by 5 in a comma separated sequence.
Sample Data : 0100,0011,1010,1001,1100,1001
Expected Output : 1010
Click me to see the sample solution
14. Write a Python program that accepts a string and calculates the number of
digits and letters.
Sample Data : Python 3.2
Expected Output :
Letters 6
Digits 2
15. Write a Python program to check the validity of passwords input by users.
Validation :
16. 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.
https://pynative.com/python-if-else-and-for-loop-exercise-with-solutions/
https://csiplearninghub.com/practice-questions-of-loops-in-python/
https://www.geeksforgeeks.org/python-exercises-practice-questions-and-solutions/
https://www.geeksforgeeks.org/python-conditional-statement-and-loops-coding-problems/