[Tutor] array

Diana Furr dleigh0 at carolina.rr.com
Sun Oct 31 18:31:34 CET 2004

I am taking a programming class that uses the book Programming Logic and Design and we program with python. We are starting on a chapter about arrays and I have a few questions. I understand from reading the chapter what an array is and why they are used, but I don't know how to make an array in python. I have read from different links on python.org but I still don't get it. 

This is the assignment:    
Write a Python code for a program that reads numbers entered from the keyboard into an array1, stores their doubles in a second array2, and prints out both arrays. For the purpose of this assignment assume that there will be no more than 10 numbers. Have the program prompt at the beginning of the program and ask how many numbers will be entered. The program should loop and ask if another set of numbers will be entered, program termination is dependent on user input. Suggested output is shown below:

Array 1    Array2

10            20

11            22

15            30

33            66

I don't want someone to give me the answer, but maybe show me what an array that is dependant on user input looks like in Python. I understand if no one wants to help but please at least point me in the right direction. 

Thank you, 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20041031/1d49040f/attachment.htm

More information about the Tutor mailing list