[Tutor] Quick Programming Question
Jared Johnson
jrod115683 at yahoo.com
Fri Oct 2 18:41:09 CEST 2015
I've been stuck on this for a while now and was wondering if you could help.
The question is:
"A pentagonal number is defined as n(3n - 1)/2 for n = 1,2 etc. So, the first few numbers are 1, 5, 12, 22 etc. Write a function with the following header that returns a pentagonal number:
def getPentagonalNumber(n):
Write a test program that uses this function to display the first 100 pentagonal numbers with 10 numbers on each line."
I am very new at programming and if you could help me out at all by putting this is the simplest terms, that would be extremely helpful!
Thanks!
More information about the Tutor
mailing list