[Tutor] coding problem

Steven D'Aprano steve at pearwood.info
Thu Oct 4 05:04:26 EDT 2018

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?


More information about the Tutor mailing list