> Computer science,,,python?

Computer science,,,python?

Posted at: 2014-12-18 
Implement function multiples that takes one integer n as input and returns the list of the first 10 multiples of n, starting with 0:

#!/usr/bin/python

def multiples(n):

.... li = []

.... for x in range(10):

.... .... li.append(n * x)

.... return li

n = int(input("Enter a number: "))

print multiples(n)

#Note: I've used "...." to represent tabs, which Y!Answers removes.

read this about loops:

https://wiki.python.org/moin/ForLoop

https://docs.python.org/2/tutorial/contr...

this is on making functions:

http://anh.cs.luc.edu/python/hands-on/3....

on lists:

http://www.tutorialspoint.com/python/pyt...

Implement function multiples that takes one integer n as input and returns the list of the first 10 multiples of n, starting with 0: