Home
(current)
π Logout
0
O Level Prectical Questions with Solutions
Paper 3 - M3-R5 Programming and Problem Solving through Python
Q N : 1 :
Write a program to print all Armstrong numbers in a given range. Note: An Armstrong number is a number whose sum of cubes of digits is equal to the number itself. E.g. 370=33+73+03
Q N : 2 :
Write a function to obtain sum n terms of the following series for any positive integer value of X:
X +X
3
/3! +X
5
/5! ! +X
7
/7! + β¦......
Q N : 3 :
Write a function to obtain sum n terms of the following series for any positive integer value of X
1+x/1!+x2/2!+x3/3!+β¦
Q N : 4 :
Write a program to multiply two numbers by repeated addition
e.g. 6*7 = 6+6+6+6+6+6+6
Q N : 5 :
Write a program to compute the wages of a daily laborer as per the following rules :-
Hours Worked Rate Applicable Upto first 8 hrs Rs100/-
a) For next 4 hrs Rs30/- per hr extra
b) For next 4 hrs Rs40/- per hr extra
c) For next 4 hrs Rs50/- per hr extra
d) For rest Rs60/- per hr extra
Q N : 6 :
Accept the name of the labourer and no. of hours worked. Calculate and display the wages. The program should run for N number of labourers as specified by the user.
Q N : 7 :
Write a function that takes a string as parameter and returns a string with every successive repetitive character replaced by ?e.g. school may become scho?l.
Q N : 8 :
Write a program that takes in a sentence as input and displays the number of words, number of capital letters, no. of small letters and number of special symbols.
Q N : 9 :
Write a Python program that takes list of numbers as input from the user and produces a cumulative list where each element in the list at any position n is sum of all elements at positions upto n-1.
Q N : 10 :
Write a program which takes list of numbers as input and finds:
a) The largest number in the list
b) The smallest number in the list
c) Product of all the items in the list
Q N : 11 :
Write a Python function that takes two lists and returns True if they have at least one common item.
Q N : 12 :
Write a Python program to combine two dictionary adding values for common keys.
d1 = {βaβ: 100, βbβ: 200, βcβ:300}
d2 = {βaβ: 300, βbβ: 200, βdβ:400}
Sample output: Counter({βaβ: 400, βbβ: 400, βdβ: 400, βcβ: 300})
Q N : 13 :
Write a program that takes sentence as input from the user and computes the frequency of each letter. Use a variable of dictionary type to maintain and show the frequency of each letter.
Q N : 14 :
Apply recursive call to do the following:
a) Product of two numbers using repetitive addition
b) Print Fibonacci series upto term n
Q N : 15 :
Write a program to input two numbers as input and compute the greatest common divisor
Q N : 16 :
Write a function that takes two filenames f1 and f2 as input. The function should read the contents of f1 and write them onto f2.
Q N : 17 :
Write a function that reads the contents of the file f3.txt and counts the number of alphabets, blank spaces, lowercase letters, number of words starting with a vowel and number of occurrences of a work βhelloβ.
Q N : 18 :
Replace consonants with next immediate consonants alphabetically in a String
Examples:
Input : str = "lionetcomputer"
Output : miopevdonquves
Input : str = "gfg"
Output : hgh
Q N : 19 :
Write a NumPy program to find the most frequent value in an array.
Q N : 20 :
Take two NumPy arrays having two dimensions. Concatenate the arrays on axis 1.
Q N : 21 :
Write a Python program to implement a calculator to do basic operations Like(+, -, *, /).
Q N : 22 :
Write a Python program to implement matrix multiplication using numpy array.
Q N : 23 :
Write a Python program to print the numbers from a given number n to till 0 using recursion.
Q N : 24 :
Python program to generate the prime numbers from 1 to N.