Can you write a Python program to check a sequence of numbers is an arithmetic progression or not?
To refresh your memory, a sequence is a set of things (usually numbers) that are in order. In an Arithmetic Sequence the difference between one term and the next is a constant. In other words, we just add the same value each time. For example, the sequence 5, 7, 9, 11, 13, 15 ... is an arithmetic progression with common difference of 2. We can write an Arithmetic Sequence as a rule: xn = a + d(n−1) How would you write it using Python? Try it yourself. If you cannot figure it out, see code on the next page.
1 Comment

AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2018
Categories
All
