0% found this document useful (0 votes)
27 views2 pages

Assignment On List, String Through Functions, Recursive Functions

The document provides instructions for an assignment on functions involving lists and strings, with 28 programming problems to be solved using various functions like recursion, sorting, searching, and string/list manipulation. Students are asked to write the code for each problem in a practical file, and submit a soft copy of their solutions by a deadline of May 5th, 2020 in either a word file, notepad file, or Python file. The problems cover a range of tasks including sorting, searching, reversing, counting, and performing mathematical operations on lists and strings.

Uploaded by

Rahul Jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views2 pages

Assignment On List, String Through Functions, Recursive Functions

The document provides instructions for an assignment on functions involving lists and strings, with 28 programming problems to be solved using various functions like recursion, sorting, searching, and string/list manipulation. Students are asked to write the code for each problem in a practical file, and submit a soft copy of their solutions by a deadline of May 5th, 2020 in either a word file, notepad file, or Python file. The problems cover a range of tasks including sorting, searching, reversing, counting, and performing mathematical operations on lists and strings.

Uploaded by

Rahul Jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

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.

15 WAF to check whether a string is palindrome or not.

16 WAF to reverse a string without using reverse function.

17 WAF to find longest word in a string.

18 WAF to find sum of the numbers which are even and divisible by 3 in a list of n numbers.

19 WAF to capitalize each word in a string.


20 WAF to count no of words in a string.
21 WAF to compute and print the sum of squares of n numbers.. Using recursion.

22 WAF to find sum of the following series using recursion...


(a) 1+2+3+4...n
(b) 1+3+5+7+9..n
(c) 1! + 2!+ 3! +4! ... n!
(d) 1! +3! +5! +7!.. n!
(e) x^1/1! +x^3/3! +x^5/5!... n
(f) x^1/2! +x^3/4! +x^5/6!... n

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.

You might also like