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

Programs Functions Strings

Uploaded by

mandalutsab4d
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)
21 views2 pages

Programs Functions Strings

Uploaded by

mandalutsab4d
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

LIST OF PROGRAMS FROM FUNCTIONS AND

STRINGS

1. Write a Python function to calculate factorial of a number.


2. Write a Python function to check whether a number is prime.
3. Write a Python function that returns the sum of digits of a number.
4. Write a Python function to generate Fibonacci series up to n terms.
5. Write a Python function to find the greatest common divisor (GCD) of two numbers.
6. Write a Python function to find the least common multiple (LCM) of two numbers.
7. Write a Python function that accepts a string and returns it in reverse order.
8. Write a Python function to check whether a string is a palindrome.
9. Write a Python function to count vowels and consonants in a string.
10. Write a Python function to count the frequency of each character in a string.
11. Write a Python function that accepts a string and converts it into uppercase.
12. Write a Python function to remove all spaces from a string.
13. Write a Python function to replace all vowels in a string with '*'.
14. Write a Python function to check if a string is an anagram of another string.
15. Write a Python function that accepts a sentence and returns the longest word.
16. Write a Python function that accepts a string and counts the number of words in it.
17. Write a Python function to find the ASCII value of each character in a string.
18. Write a Python function to capitalize the first letter of each word in a string.
19. Write a Python function that checks whether two strings are rotations of each other.
20. Write a Python function that finds the first non-repeated character in a string.
21. Write a Python function to find the largest word in a sentence.
22. Write a Python function to remove duplicate characters from a string.
23. Write a Python function to count the number of digits, alphabets, and special characters in a
string.
24. Write a Python function that accepts two strings and concatenates them.
25. Write a Python function to check whether a string contains only digits.
26. Write a Python function to check whether a string contains only alphabets.
27. Write a Python function that returns the smallest word in a sentence.
28. Write a Python function to count the number of uppercase and lowercase letters in a string.
29. Write a Python function that accepts a string and prints it in title case.
30. Write a Python function to check whether a string starts and ends with the same character.
31. Write a Python function to count occurrences of a given substring in a string.
32. Write a Python function that returns the longest palindrome in a given string.
33. Write a Python function to remove all punctuation from a string.
34. Write a Python function to sort the characters of a string alphabetically.
35. Write a Python function to check whether a string is symmetric or not.
36. Write a Python function to find all substrings of a given string.
37. Write a Python function that counts the number of unique words in a sentence.
38. Write a Python function to accept a string and return its ASCII sum.
39. Write a Python function that checks if a string is a pangram (contains all alphabets).
40. Write a Python function to find the maximum occurring character in a string.
41. Write a Python function to print all permutations of a string.
42. Write a Python function that removes the nth character from a string.
43. Write a Python function to accept two strings and return the common characters.
44. Write a Python function to check whether a given word is present in a sentence.

You might also like