1. Write a python program to add in all the numbers with using function.
The output is:
numbers = (58, 5, 13, 1, 27)
Expected Answer:
The sum of number (58, 5, 13, 1, 27): 104
2. Write a python program generate a function to find the maximum number among three numbers.
The output is:
numbers = (49, 66, -25)
Expected Answer:
The maximum number among three numbers: 66
3. Write a python program generate a function to reverse the input value.
The output is:
input vale = Python3
Expected Answer:
The reverse of input: 3nohtyp
4. Write a python program generate a function to multiply all the number in the following output.
The output is:
numbers = 2, 5, 7, 9, 1, 2
Expected Answer:
The multiplication of all the given numbers: 1260
5. Write a python program generate a function to filter out the repeated string in a given list, list_a.
The output is:
list_a = [2,3,4,5,6,6,4,5]
Expected Answer:
The new list: [1, 2, 3, 4, 5]
6. Write a python program generate a function to identify whether the specified number is in the range of initial value, list_a in the following output.
The output is:
list_a = [1, 2, 3, 4, 5, 6, 7, 8]
First number: 5
Second number: 9
Expected Answer:
First answer: 5 is in the range
Second number: The number 9 is outside the given range.
7. Write a python program to generate a function to accept an input string therefore count the number of lowercase and uppercase respectively.
The output is:
input string = 'Welcome to learn Python on Freelearningpoints website'
Expected Answer:
The initial string is: Welcome to learn Python on Freelearningpoints website
The number of uppercase characters is: 3
The number of lowercase Characters is: 44
8. Write a python program to generate a function to print out the odd number from a given list, list_a as provided in the following output.
The output is:
list_a = [3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
Expected Answer:
The odd numbers: [3, 5, 7, 9, 11]
9. Write a python program to generate a function to print out square number of a given list, list_a as provided in the following output.
The output is:
list_a = [2, 4, 6, 8, 10]
Expected Answer:
The square number is:
[4, 16, 36, 64, 100]
10. Write a python program to generate a function to sum up four input values.
The output is:
values = 2, 5, 3, 6
Expected Answer:
The sum number is: 16
11. Write a python program to generate a function to check whether the input alphabet is vowel or not.
The output is:
Input: letter "a" and "z"
Expected Answer:
Is letter 'a' a vowel: True
Is letter 'z' a vowel: False
12. Write a python program to generate a function to combine different integer into one integer without undergoing normal mathematics operation.
The output is:
Integer list: [2, 8, 32, 6, 5]
Expected Answer:
The integers [2, 8, 32, 6, 5] are combined into: 283265
13. Write a python program to generate a function to do the additional operation from different integer undergoing normal mathematics operation.
The output is:
Integer list: [2, 8, 32, 6, 5]
Expected Answer:
The summation of [2, 8, 32, 6, 5] is 53
14. Write a python function to generate the addition of two input value, for addition result in the range of 30 to 35, change the result to 30.
The output is:
three sets of input values:
x = (10, 15)
y = (9, 22)
z = (32, 16)
Expected Answer:
25
30
48
15. Write a python function to show the details of student name, student age, cumulative score, and course in University and arranged in four separate lines.
The output is:
Expected Answer:
Student name: Mason
Student age: 20
Cumulative score: 3.9
Course: Computer Science
16. Write a python function to check whether the given list a and list b consist any repeated items.
The output is:
list_a = ['python', 'exercise', 'tutorial', 'practice']
list_b = 'python', 'exercise', 'tutorial', 'practice', 'tutorial'
Expected Answer:
No repeat terms: True
No repeat terms: False
17. Write a python function to print out and remove every third items in the list a as provided until remove all the items in the list a.
The output is:
list_a = ['python', 'exercise', 'tutorial', 'practice', 'free', 'numpy', 'pandas']
Expected Answer:
tutorial
numpy
exercise
pandas
free
python
practice
18. Write a python function to check whether the summation of any two number in list a and list b equal to a given number.
The output is:
list_a = [11, 6, 1, 4]
list_b = [21, 17, 4, 8]
Expected Answer:
True
False
19. Write a python function to count the negative number in the list a and list b.
The output is:
list_a = [6, 2, 7, -8, -5]
list_b = [3, 2, 7, 9, -5, 1]
Expected Answer:
Count of negative number: [2]
Count of negative number: [1]
20. Write a python function to count the number of same numbers with 3 given numbers in the list a and list b.
The output is:
list_a = [6, 6, 6]
list_b = [9, 7, 8]
Expected Answer:
The count of equal number is 3
The count of equal number is 0
21. Write a python function to verify whether the student id are correct with 8 digits.
The output is:
student id 1 = 22365679
student id 2 = 1234567j
Expected Answer:
True
False
More Exercises:
Python String ExercisesMore Numpy Exercises:
Numpy String ExercisesMore Pandas Exercises:
Pandas Series ExercisesMore Tutorials:
Python Installation - Linux (Ubuntu)