List of Practical Questions (1)
List of Practical Questions (1)
7. WAP that accepts some numbers and display the following data. The process should continue when
the user enters 0:
a. Sum of all the even number c. Average of the numbers entered.
entered. d. Largest and smallest number
b. Total number of odd numbers entered.
entered. e. All the numbers that ends with 4.
8. WAP that accepts a number and displays its factorial in the following format.
Suppose user enters 5, the output should be:
5 ! = 5 X 4 X 3 X 2 X 1 = 120
9. WAP that displays the following pattern:
c. e.
a.
d. f.
b.
10. WAP that accepts a string and capitalize every alternate character. The program should display the
original and new strings.
11. WAP that accepts emailIDs of n users. Create two lists that stores user ID and domain names
separately.
12. WAP that accept a line and display each word on separate lines.
13. WAP to accept an address containing pincode. Extract the pincode from the address and display
them. The process should continue till the user presses ‘Y’ or ‘y’.
14. WAP that accepts a string. Extract all the digits from the string.
If there are digits, display:
a. Sum of all the digits entered.
b. Print:
i. Original string
ii. Digits
iii. Sum of digits
If there are no digits,
a. Print <original string > has no digits.
15. WAP that accepts WAP that accepts a list & determine whether the no is present in 1 st half or the 2nd
half of the list.
16. WAP that accepts WAP that accepts a list & interchanges the 1st half elements with the 2nd half
elements of the list.
17. WAP to create a list of strings. The list must create a new list same as he first with its 1 st character
removed.
18. WAP to accept a list of numbers & perform left shift.
19. WAP to accept a list of numbers & perform right shift.
20. WAP to accept the nested tuple and print mean of each nested tuple. The program must then display the
mean of each mean calculated.
21. WAP to accept roll number, name and marks of n students. Store the data in the form of Dictionary in
which keys are roll number and values are in the form of list of name and marks. The program must then
ask the roll number and display its corresponding marks.
22. Given a dictionary:
X={ k1 : v1 , k2 : v2 , k3 : v3 }
Create another dictionary with opposite mapping. Ie.
Y={ v1 : k1 , v2 : k2 , v3 : k3 }
23. WAP to accept the string and display total number of occurrences of each character.
24. A dictionary D1 has values in the form of list of numbers write a program to create a new dictionary D2
having same keys as D1 one but values are as sum of list of values.
25. WAP to perform to perform sorting on list of numbers.
INDEX