Solution Exercise 70: Python algorithm that tests whether a list is symmetric or not
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…
Python Courses & Exercises with solutions !
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…
Exercise 65 Given a list of strings, write a Python algorithm allowing which replace the elements of the list with their lengths. Example: if L = ["Python", "Django", "Numpy", "Sympy"]…