Solution Exercise 71: python algorithm which translate a given list
Exercise 71 Write a Python algorithm that transforms a list of integers L = [n1, n2, n3, ..., np] by adding 1 to the first element, 2 to the second…
Python Courses & Exercises with solutions !
Exercise 71 Write a Python algorithm that transforms a list of integers L = [n1, n2, n3, ..., np] by adding 1 to the first element, 2 to the second…
Exercise 70 Write a Python algorithm to test if a given list is symmetric using the reverse() method. Example: for L1 = [2, 5, 11, 5, 2] the algorithm returns…
Exercise 69 Write a Python algorithm which determines for a given integer n the list of tuples of integers (p, q) satisfying: p2 + q2 = n Solution #coding: utf-8def…
Exercise 68 Write a Python algorithm which determines for a given integer, the list of perfect squares between 1 and n. Example if n = 100 the algorithm returns the…
s = input ("Type a number:") int_s = int (s) #Conversion of string to intprint (type(int_s)) float_s = float (s) #Conversion of string to floatprint (type(float_s)) complex_s = complex (s)…
Exercise 67 Write without using any predefined function a Python algorithm as a function which takes as parameter a list of integers L and which returns True if the list…
Exercise 66 Write a Python algorithm to extract the list of integers from a list of numbers. Example: if L = [2.5 , 11.54 , 3 , 7.35 , 5…