Those numbers are meant to be the output, not the input. The program i am trying to generate will take (x1,y1) and (x2.y2) and find every possible point that exists between them.
For input -3,5 5,-3 I would expect an output of:
-3, 5 -2, 5 -1, 5 0, 5 1, 5 2, 5 3, 5 4, 5 5, 5
-3, 4 -2, 4 -1, 4 0, 4 1, 4 2, 4 3, 4 4, 4 5, 4
-3, 3 -2, 3 -1, 3 0, 3 1, 3 ...
User Profile
Collapse
-
And sorry for that last post. I meant to edit that out, i realized that was extremely impatient; expecially for how unclear i may have been.Leave a comment:
-
thanks for your reply. I want to find the numbers between between 2 sets of ordered pairs. So between say -3,5 and 5,-3 would be
-3, 5 -2, 5 -1, 5 0, 5 1, 5 2, 5 3, 5 4, 5 5, 5
-3, 4 -2, 4 -1, 4 0, 4 1, 4 2, 4 3, 4 4, 4 5, 4
-3, 3 -2, 3 -1, 3 0, 3 1, 3 2, 3 3, 3 4, 3 5, 3
-3, 2 -2, 2 -1, 2 0, 2 1, 2 2, 2 3, 2 4, 2 5, 2...Leave a comment:
-
Outputting Points between numbers
Im new to programming, expecially c++. I started off in python but really just know the basics.
My question is, how would i go about writing a program that would output all of the numbers (whole numbers) on a plane between X and Y, saw 0,0 and 10,10?
I can get my code to write the basics from 0-10 with a while loop, but only for 1 axis.
[code=cpp]
#include<iostre am>
... -
Thanks for your help, i think i got it!
[CODE=python]# database
# Query on database
def query(course, grade):
courseindex=dat abase[0].index(course)
for record in range(1,len(dat abase),1):
if database[record][courseindex]==grade:
print database[record][0]
print("\n")
raw_input("pres s enter to continue\n\n\n" )
...Leave a comment:
-
That makes sense. Im sure this is an easy function, but i dont see how to use append. By using global, i see that i can modify the database, but i dont see how i could append what i need to where i need to?Leave a comment:
-
I see the changes you made to the first function. Would what i had originally have worked?Leave a comment:
-
I see what you are saying here, but this code was already written. I am trying to modify someone elses code and create functions with what is already give.Leave a comment:
-
help with append and delete
Hello everyone. New to python as well as this forum, but i must say ive learned a but already reading through some posts. Seems to be a pretty helpful community here.
Before i post a question ill give you a little background. I have done programming in the past in Basic, VB, and a little C. I am not much of a programmer, its more of a hobby/curiosity.
The following code is not mine, i am trying to modify a template...
No activity results to display
Show More
Leave a comment: