Ask your own question, for FREE!
Computer Science 11 Online
OpenStudy (anonymous):

Introductory Python: Can someone help me with the simpler task of 'write the Python function "n_times" that reads a integer n from the user via the keyboard, and prints out n once per line on n lines'?

OpenStudy (asnaseer):

def n_times(): n = input("enter a number:") for i in range(0, n): print n

OpenStudy (rsmith6559):

The input line should be (in Python 2.x): n = int( raw_input( "enter a number: " )

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!