Python Forum
Creating lists or arrays as the input - 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: Creating lists or arrays as the input (/thread-2647.html)



Creating lists or arrays as the input - nickalvar - Mar-31-2017

I'm fairly new to using python. I would greatly appreciate it if someone could explain exactly what i'm supposed to do here.

Create the following lists or arrays as the input:
A = [1, 2]
B = [3, 4]
I want the following output
1, 3
1, 4
2, 3
2, 4

Shown in the actual program the top part is the input, and the bottom part is the output.

The question is what kind of loop or series of loops will produce this kind of output?  

Notice how the left side (1, and 2) are different than the right side (3, 4 then 3, 4)


RE: Creating lists or arrays as the input - wavic - Mar-31-2017

It's clear enough. What exactly you do not understand?
You have an input and have to produce a specific output. Start with the input as a first step. Show us what you are trying to do=


RE: Creating lists or arrays as the input - Larz60+ - Mar-31-2017

loop through first list
for each iteration of first loop,
loop through second list


loops - nickalvar - May-03-2017

I have this assignment here and was hoping someone could provide the code so that I have a reference for my homework assignment. thanks.
IT 3210
Practice Assignment
 
Loops
 
Create the following lists or arrays as the input:
A = [1, 2]
B = [3, 4]
I want the following output
1, 3
1, 4
2, 3
2, 4
 
Shown in the actual program the top part is the input, and the bottom part is the output.
 
The question is what kind of loop or series of loops will produce this kind of output? 
 
Notice how the left side (1, and 2) are different than the right side (3, 4 then 3, 4)


RE: Creating lists or arrays as the input - nilamo - May-03-2017

Welcome to the forum!

We're not going to write your homework for you, but we WILL be willing to help if you have any issues along the way.
So the place to start, is to write some code (there were tips on that previously), and if it doesn't work, gives errors, or the output is different from what you expect, we can help you on the right path.
But we won't do it for you.

Oh, and copy/pasting the same thing twice doesn't help anyone :p