Solution Exercise 44: class circle en python
Exercise 44. Circle class 1 - Define a Circle class allowing to create a circleC (O, r) with center O(a, b) and radius r using the constructor: def __init__(self,a,b,r): self.a…
Python Courses & Exercises with solutions !
Exercise 44. Circle class 1 - Define a Circle class allowing to create a circleC (O, r) with center O(a, b) and radius r using the constructor: def __init__(self,a,b,r): self.a…
Exercise 72 Write a function which takes an element x and a list L as a parameter, and returns the list of positions of x in L. The function must…
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)…