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

Python Function Problems

The document lists 30 programming tasks that involve creating various functions. These tasks cover a range of topics including mathematical operations, string manipulation, and data structure handling. Each task specifies a specific functionality to be implemented in a programming language.

Uploaded by

Pule Mothobi
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)
4 views2 pages

Python Function Problems

The document lists 30 programming tasks that involve creating various functions. These tasks cover a range of topics including mathematical operations, string manipulation, and data structure handling. Each task specifies a specific functionality to be implemented in a programming language.

Uploaded by

Pule Mothobi
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

1. Write a function that returns the square of a number.

2. Write a function that checks if a number is even.

3. Write a function that returns the largest of three numbers.

4. Write a function that counts vowels in a string.

5. Write a function that reverses a string.

6. Write a function that sums all elements in a list.

7. Write a function that checks if a string is a palindrome.

8. Write a function that finds the factorial of a number.

9. Write a function that converts Celsius to Fahrenheit.

10. Write a function that finds the smallest value in a list.

11. Write a function that returns the number of words in a sentence.

12. Write a function that merges two lists.

13. Write a function that removes duplicates from a list.

14. Write a function that generates the first n Fibonacci numbers.

15. Write a function that checks if a number is prime.

16. Write a function that returns the sum of digits of a number.

17. Write a function that counts occurrences of an element in a list.

18. Write a function that returns the average of numbers in a list.

19. Write a function that checks if two strings are anagrams.

20. Write a function that returns the second-largest number in a list.

21. Write a function that converts each string in a list to uppercase.

22. Write a function that removes all spaces from a string.

23. Write a function that returns the last element of a list.

24. Write a function that finds the common elements between two lists.

25. Write a function that checks if a character is a consonant.

26. Write a function that prints a multiplication table for a number.

27. Write a function that flattens a nested list.

28. Write a function that finds the longest word in a sentence.

29. Write a function that returns a dictionary of character frequencies.


30. Write a function that checks if all elements in a list are unique.

You might also like