This is for an assignment at school and I'm stuck on this question.
Write an algorithm which displays on a new line on the screen, the first 20 values of multiples of 9, using a formula as follows. 9 * n, 9*(n+1),9*(n+2)
I am supposed to make an algorithm with pseudocode or a flow chart, I've been trying it with python3.4 but I cant seem to print out more than (9,18,27).
This is my code:
def multiples():
for n in range(0, 2):
a = 9*n, 9*(n+1), 9*(n+2)
print (a)
Can someone please tell me where I'm going wrong and possibly show me a better way of doing this with pseudocode or a flow chart. (Thats how the teacher wants it done) I just use Python to see if it actually works. Thank you.