Solution Exercise 9: python program that compute the factorial of an integer n
Exercise 9. Write a program in Python that asks the user to enter an integer n and display n! Solution
Cours Python
Exercise 9. Write a program in Python that asks the user to enter an integer n and display n! Solution
Exercise 8 Write a python algorithm that asks the user to enter an integer n and displays the value of the sum 1 + 2 + … + n = ?
Exercise 7 Write a Python algorithm that asks the user to enter 3 numbers x, y and z and display their maximum without using any predefined function.
Exercise 12 By using the sort() method, write an algorithm in python as a function which takes a list L of numbers as a parameter and which returns the tuple (min , max) formed from the minimum and the maximum of the list.
Exercise 12 . 1) – Write a program in Python that asks the user to enter an integer n and display him the multiplication table of this number. 2) – Improve the program so that it displays the multiplication tables of all the numbers between 1 and 9
Exercise 11 Write an algorithm in python as a function which takes as parameters a tuple (L, n) formed by a list L of numbers and an integer n and which returns the list obtained from L by multiplying its elements by n . Example if L = [13, 11, 7, 25] and n =…
Exercise 10 Write an algorithm in python as a function which takes as a parameter a tuple (L, a) formed by a list L and an element 'a' and which returns the position of the element 'a' in the list L. The function must return -1 if the element 'a' is not in the list.
Exercise 8 Write an algorithm in python that returns the average of the terms of a list of numbers.
Exercise 7 Write a Python program that returns the list of divisors of a given integer. Example if n = 36 , the algorithm returns the list [1, 2, 3, 6, 9, 18 , 36]