Exercises to Practice (Module 10)
Exercise 1
Write down a pseudocode solution and then convert it to Python code.
Write a function to find the Maximum of three numbers and call this function inside the main program twice with different arguments of your choice.
Exercise 2
Write a Python function to sum all the numbers in a list.
Sample List : (9, 2, 3, 0, 6)
Expected Output : 20
Exercise 3
Write a Python function to calculate the factorial of a number (a non-negative integer). The function accepts the number as an argument.
Exercise 4
Write a Python function to check whether a given number (accept from the user) is odd or even. Please create a flowchart of your solution first.
Exercise 5
Write a Python program to print the even numbers from a given list.
Sample List : [1, 2, 3, 4, 5, 6, 7, 8, 9]
Expected Result: [2, 4, 6, 8]
Exercise 6
Write a function that takes radius as input and returns the area of a circle. The area of a circle is equal to pi times the radius squared.
# (Use the math.pi in order to represent Pi.)
Άσκηση 7
Write a function to find the minimum of two numbers. Then get 3(three) numbers from the keyboard and use this function to find the minimum of the numbers entered.
Exercise 8
Write a function that sorts 3 integers that accepts from the keyboard