Question: (write the code in python) Write function geometric() that takes a list of integers as input and returns True if the integers in the list
(write the code in python)
Write function geometric() that takes a list of integers as input and returns True if the integers in the list form a geometric sequence. A sequence a0, a1, a2, a3, a4, . . . , an 2, an 1 is a geometric sequence if the ratios a1/a0, a2/a1, a3/a2, a4/a3, . . . , an 1/an 2 are all equal. >>> geometric([2, 4, 8, 16, 32, 64, 128, 256]) True >>> geometric([2, 4, 6, 8]) False
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
