Skip to content

Instantly share code, notes, and snippets.

@dev001hajipro
Created February 3, 2019 08:50
Show Gist options
  • Save dev001hajipro/2a2486e186bcbd9754fd8880096ed837 to your computer and use it in GitHub Desktop.
Save dev001hajipro/2a2486e186bcbd9754fd8880096ed837 to your computer and use it in GitHub Desktop.
# a initial term
# d common_difference
def arithmetic_progression(a = 0, d = 0, n = 1):
print(a + (d * (n-1)))
return a + (d * (n-1))
def main():
nnn = [arithmetic_progression(5, 2, i) for i in range(1,10)]
print(nnn)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment