Python Forum
Newbie here. Create an array from file data? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Newbie here. Create an array from file data? (/thread-39173.html)



Newbie here. Create an array from file data? - Rayj00 - Jan-13-2023

I'm brand new with python. I have a file with integers like this:

2 5 8 12 20
3 12 15 18 29
etc,
etc,
etc,
.
.
etc.

I need to get them into an array (I think) so I can evaluate each integer and perform some computations on them.

Just looking for a hint on how to get the integers into the array.

Appreciate it.

Ray


RE: Newbie here. Create an array from file data? - menator01 - Jan-13-2023

Have a look at python list


RE: Newbie here. Create an array from file data? - perfringo - Jan-13-2023

(Jan-13-2023, 12:37 AM)Rayj00 Wrote: I need to get them into an array (I think)

First rule of problem solving is defining the desired objective. If you don't know what your objective is then it's next to impossible to solve the problem.