Re: [Tutor] coding problem

2018-10-04 Thread Steven D'Aprano
On Wed, Oct 03, 2018 at 11:22:45PM -0500, ramanpreet baidwan wrote:

> Can anyone tell me how to code to display permutations in a table for 
> all values of z=x^2+y by getting input from user for range of x and y?

Yes. Use a text editor to write your code in a text file. When you save 
the file, use .py as the file extension, not .txt.

Do you know how to program? It sounds like you are doing homework. You 
should start by showing us the code you have already written. If you 
have written no code at all, tell us what you know how to do and ask 
*specific* questions.

Terrible question: "Can somebody do my home work for me?"

Bad question: "How do I write this code?"

Good question: "How do I write a for loop?"

Excellent question: "I tried to write a for-loop from 1 to 5, but it 
only went to 4. Here is my code. What did I do wrong?"

If you ask excellent questions, we can give you excellent answers.

Do you know how to use print? Do you know how to get input from the 
user? Can you write a for-loop over a range from x to y?


-- 
Steve
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] coding problem

2018-10-04 Thread Alan Gauld via Tutor
On 04/10/18 05:22, ramanpreet baidwan wrote:
> Can anyone tell me how to code to display permutations in a table 
> for all values of z=x^2+y by getting input from user for range of x and y?

There are several problems with your question.
First it sounds suspiciously like homework and
we won't do that for you.
(Although we will give you some pointers)

Second permutations sounds like the wrong word.
I suspect you just want all the solutions for
z displayed in a table against x,y pairs.
Is that correct?

Next, taken literally, the problem is impossible
since x,y have an infinite number of values. So to
have any chance you need to define the quantum
steps between x and y - integers, 0.1, 0.01, etc.
Otherwise you need to draw a graphical representation
rather than use a table.

Finally, its not clear what you are asking for help with.
Do you not know how to present output in a table format?
Do you not know how to calculate z?
Do you not know how to prompt the user for inputs?
Do you not know how to generate the x,y values from
the users input?

It's best if you can write some code then send us
that along with the output (including full error
message, if any). Then ask a specific question about
what is going wrong and how you want us to help.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] coding problem

2018-10-04 Thread Mark Lawrence

On 04/10/18 05:22, ramanpreet baidwan wrote:

Can anyone tell me how to code to display permutations in a table for all 
values of z=x^2+y by getting input from user for range of x and y?



Sorry but no as we do not do homework.

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] coding problem

2018-10-04 Thread ramanpreet baidwan
Can anyone tell me how to code to display permutations in a table for all 
values of z=x^2+y by getting input from user for range of x and y?

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor