0% found this document useful (0 votes)
16 views3 pages

Set 4

The document outlines 10 python function problems including computing an expression, swapping integers, finding the factorial, determining if a number is odd/even, checking if less than 10, finding the max of a list, summing a list, finding the second lowest in a list, summing the digits of a number, and checking if a number is a palindrome.
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)
16 views3 pages

Set 4

The document outlines 10 python function problems including computing an expression, swapping integers, finding the factorial, determining if a number is odd/even, checking if less than 10, finding the max of a list, summing a list, finding the second lowest in a list, summing the digits of a number, and checking if a number is a palindrome.
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/ 3

Set-4

1. Write a python function which computes the


following expression for a given x = 4,y = 2.

3x 2 + y 2 + 5x − 7y + 14

2. Write a python function that swap two integers.

3. Write a python function that returns factorial of


an integer.

4. Write a python function that determines whether


an integer is odd or even.

5. Write a python function that determines whether


an integer is less than 10 or not. The function
will return 0, if it is less than 10, otherwise it will
return 1.

6. Write a python function that returns the


maximum number of the following list.

list = [2, 9, 4, 1, 10, 3]

7. Write a python function that returns the sum of


the elements of the following list.

list = [4, 3, 6, 1, 2, 5, 7]

8. Write a python function that returns the second


lowest number of the following list.

list = [7, 9, 1, 1, 7]

9. Write a python function that returns the sum of


digits of an integer.

10. Write a python function that determines whether


an integer is palindrome or not. The function will
return 1, if it is palindrome, otherwise it will
return 0.

You might also like