Assignment On List, String Through Functions, Recursive Functions
Assignment On List, String Through Functions, Recursive Functions
INSTRUCTIONS:
COMPLETE THE ASSIGNMENT II ON FUNCTIONS TILL 05/05/2020..AND SEND THE SOFT
COPY IN WORD FILE LATER THESE ASSGNMENTS TO BE WRITTEN IN PRACTICAL FILE
To be done in the practical copy..send the soft copy of codes in word file..or notepad..or .py files..any
method of function may be adopted untill specified in the program..
All the function program should contain main also.
There will be another assignment on basic functions, loops programs through functions..both the
assignments should be send in soft copy as well as to be written neatly in the assignment file.
All the programs should have inputs from user
For programs needs swapping or interchanging only one list should b used..with list having N numbers
entered by the user .n may be odd or even
1. WAF(Write a function) to exchange first half of list with second half elements of list for n numbers. n
may be odd or even. ex:L=[1,2,3,4,5] output L=[4,5,3,1,2]
2 WAP to swap the content with next value divisible by 6 for n numbers entered by the user.
ex: L=[3,6,45,30,7] output L=[6,3,45,7,30]
3 WAP to find sum of all the elements of a list which ends with 7. Ex :L=[37,8,67,9,56] sum=104
4 WAP to swap the contents of a list for n numbers as per the following example:
Ex :L=[1,2,3,4,5,6,7] output :L=[2,1,4,3,6,5,7]
5 WAF to reverse a list of n numbers without using reverse function.
EX: L=[1, 2,3,4,5].OUTPUT:L=[5, 4,3,2,1]
6 WAF to find greatest among a list of n different Numbers entered by the user . Where the elements
are not arranged.
7 WAF to find second greatest among a list of n different Numbers entered by the user . Where the
elements are not arranged.
8 WAF to find second smallest among a list of n different Numbers entered by the user . Where the
elements are not arranged.
9 WAF to find smallest among a list of n different Numbers entered by the user , Where the elements
are not arranged.
10 WAF to search a number using binary search having definition binarysearch (A, l. R, x).. To search the
element x.. Where A is list of n numbers, l is begin or lower bound, R is last or upper bound.
11 WAF to sort or arrange a list of n numbers in ascending order using bubble sort.
12 WAF to sort or arrange a list of n numbers in ascending order using insertion sort.
13 WAF to sort or arrange a list of n numbers in descending order using bubble sort.
14 WAF to count vowels, consonants, spaces, other characters in a string given by the user.
18 WAF to find sum of the numbers which are even and divisible by 3 in a list of n numbers.
23 WAF to compute greatest common division of two numbers a and b which are entered by the user
using recursion.
24 WAF to find factorial of a number using recursion.
25 WAF to search a number using binary search having definition binarysearch(A, l. R, x).. To search the
element x.. Where A is list of n numbers, l is begin or lower bound, R is last or upper bound using
RECURSION.
26 WAF to find whether a number is palindrome or not.. Using recursion
27 WAF to find whether a number is Armstrong or not using recursion.
28 Write a recursive function to print a string backwards.