Professional Documents
Culture Documents
Practicalquestions
Practicalquestions
1.Write a program to add the odd numbers upto( and including) a given value N and print the result.
2.Write a program to remove duplicate items from a list.
1.Write a program to find largest number of the numbers entered through keyboard. The user can enter numbers
until he wishes or wants.
2.Write a program to put even and odd elements in a given list(l) into two lists(le,lo) such that all even elements
should be in one list(le) and odd element in another list(lo)
For example if the given input list is [1,2,60,70,65,87,34,9], then output should be
Even list=[2,60,70,34]
Odd list=[1,65,87,9]
1.Write a program to check whether a given integer number is a perfect number or not.
2.Write a program to replace all occurrences of ‘a’ with ‘$’ in a given string.
1.Write a program to print the pattern
A
AB
ABC
ABCD
1. Write a program to print all integers that are not divisible either by 2 or 3 and lie between 1 and 5(inclusive
of both numbers)
2. Write a program to enter list of strings and reverse each string in a list.
For example, if list is [‘abc’, ‘wxyz’, ‘pqr’, ‘stuvwx’]
The output should be [‘cba’, ‘zyxw’, ‘rqp’, ‘xwvuts’]