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,

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 t

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,

[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/m

Re: [Tutor] Coding question: How to call a function when the function is assigned a variable

2017-10-23 Thread Alan Gauld via Tutor
On 23/10/17 01:40, Historitical Show wrote: > Here is what I have so far: > > import time > coins = 0 > score = 0 > cptype = 1 > start = time.time() > end = time.time() Note that you are setting start and end to almost identical times and never change then later. > def main(): > global coin

[Tutor] Coding question: How to call a function when the function is assigned a variable

2017-10-22 Thread Historitical Show
This is what I have so far. I am trying to make it so that it measures how long it takes the user to get 20 scores. If it takes 1 second or less,then then they are obviously spamming ENTER by holding it down. I want tocheck and if they are holding down the key, then it will pause the program.

Re: [Tutor] coding help with maxwell-boltzmann distribution

2017-10-13 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Yes we can vectorize. regards, Sarma. On Fri, Oct 13, 2017 at 9:43 PM, Peter Otten <__pete...@web.de> wrote: > D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > > f = np.zeros(40) > > v = np.arange(0,4,0.1) > > for i in np.arange(0, 40): > > f[i] = v[i]**2*(np.exp(-v[i]**2)) > > Note that you can write th

Re: [Tutor] coding help with maxwell-boltzmann distribution

2017-10-13 Thread Peter Otten
D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > f = np.zeros(40) > v = np.arange(0,4,0.1) > for i in np.arange(0, 40): > f[i] = v[i]**2*(np.exp(-v[i]**2)) Note that you can write this without Python loop as v = np.arange(0, 4, 0.1) f = v**2 * np.exp(-v**2) __

Re: [Tutor] coding help with maxwell-boltzmann distribution

2017-10-13 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Except for some constants the essential behaviour of Maxweell-Boltzmann distribution is determined by v**2 * exp(-v**2) The following code will gove you a plot of the shape of the curve. from matplotlib import pyplot as plt import numpy as np f = np.zeros(40) v = np.arange(0,4,0.1) for i in np.ara

Re: [Tutor] coding help with maxwell-boltzmann distribution

2017-10-13 Thread Mark Lawrence via Tutor
On 12/10/17 21:22, Cameron McKay wrote: Hello, I've never used python trying to plot a graph. Thus I am having difficulties trying to plot the maxwell-boltzmann distribution. right now i've defined the y-axis given the probability, but the difficult part is trying to plot x in the form of: x =

Re: [Tutor] coding help with maxwell-boltzmann distribution

2017-10-12 Thread William Ray Wing
> On Oct 12, 2017, at 4:22 PM, Cameron McKay wrote: > > Hello, > > I've never used python trying to plot a graph. Thus I am having > difficulties trying to plot the maxwell-boltzmann distribution. right now > i've defined the y-axis given the probability, but the difficult part is > trying to

Re: [Tutor] coding help with maxwell-boltzmann distribution

2017-10-12 Thread Alan Gauld via Tutor
On 12/10/17 21:22, Cameron McKay wrote: > I've never used python trying to plot a graph. Thus I am having > difficulties trying to plot the maxwell-boltzmann distribution. Bear in mind that this list is for people learning the Python language and its standard library(as defined on python.org). A

[Tutor] coding help with maxwell-boltzmann distribution

2017-10-12 Thread Cameron McKay
Hello, I've never used python trying to plot a graph. Thus I am having difficulties trying to plot the maxwell-boltzmann distribution. right now i've defined the y-axis given the probability, but the difficult part is trying to plot x in the form of: x = v/(2kT/m)^(1/2) before i used the linspac

Re: [Tutor] Coding help 1D diffusion equation

2016-06-28 Thread Oscar Benjamin
On 26 Jun 2016 13:39, "Severin Langberg" wrote: > > Hello! > > I have a problem with solving the 1D diffusion equation for Gaussian > initial using odeint. Anyone care to help? Odeint is for ordinary differential equations (ODEs). The diffusion equation is a partial differential equation (PDE).

Re: [Tutor] Coding help 1D diffusion equation

2016-06-26 Thread Alan Gauld via Tutor
On 26/06/16 13:16, Severin Langberg wrote: > I have a problem with solving the 1D diffusion equation for Gaussian > initial using odeint. Anyone care to help? You need to realize that most folks on this list have no idea what that means. You need to provide a bit more detail. What is the 1D diffu

[Tutor] Coding help 1D diffusion equation

2016-06-26 Thread Severin Langberg
Hello! I have a problem with solving the 1D diffusion equation for Gaussian initial using odeint. Anyone care to help? Best, S ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinf

Re: [Tutor] Coding

2014-12-09 Thread Alan Gauld
On 09/12/14 17:50, Awais Idris wrote: I haven't got a reply from alan and stephen You should have gotten another one from me, quoting Steven's response, earlier today. How are you reading the list? Is it by email or are you using an archive or newsfeed. (For example I use the gmane.org newsfe

Re: [Tutor] Coding

2014-12-09 Thread Awais Idris
I haven't got a reply from alan and stephen On 8 December 2014 at 23:34, Danny Yoo wrote: > On Mon, Dec 8, 2014 at 3:06 PM, Awais Idris <2010-3...@slougheton.com> > wrote: > > The problem is when i enter my first choice it accepts it fine and well. > > When it says would you like a second item,

Re: [Tutor] Coding

2014-12-09 Thread Alan Gauld
On 08/12/14 23:06, Awais Idris wrote: The problem is when i enter my first choice it accepts it fine and well. When it says would you like a second item, andi say yes it listd the options and says have a good day and the program cuts off. In wondering if this is a problem with the statements? A

Re: [Tutor] Coding

2014-12-09 Thread Awais Idris
The problem is when i enter my first choice it accepts it fine and well. When it says would you like a second item, andi say yes it listd the options and says have a good day and the program cuts off. In wondering if this is a problem with the statements? On 8 December 2014 at 22:49, Awais Idris <

Re: [Tutor] Coding

2014-12-08 Thread Danny Yoo
On Mon, Dec 8, 2014 at 3:06 PM, Awais Idris <2010-3...@slougheton.com> wrote: > The problem is when i enter my first choice it accepts it fine and well. > When it says would you like a second item, andi say yes it listd the options > and says have a good day and the program cuts off. In wondering i

Re: [Tutor] Coding

2014-12-08 Thread Awais Idris
Ok thank you i appreciate your help On Monday, 8 December 2014, Danny Yoo wrote: > On Mon, Dec 8, 2014 at 12:14 PM, Awais Idris <2010-3...@slougheton.com > > wrote: > > The problem is when i enter my first choice it accepts it fine and well. > > When it says would you like a second item, andi sa

Re: [Tutor] Coding

2014-12-08 Thread Danny Yoo
On Mon, Dec 8, 2014 at 12:14 PM, Awais Idris <2010-3...@slougheton.com> wrote: > The problem is when i enter my first choice it accepts it fine and well. > When it says would you like a second item, andi say yes it listd the options > and says have a good day and the program cuts off. In wondering

Re: [Tutor] Coding

2014-12-08 Thread Alan Gauld
On 08/12/14 02:24, Steven D'Aprano wrote: Python sees it like: if FirstChoice == ('Coke' or 'Pepsi' or 'Water'): So evaluates the bit in parens first which results in a boolean value of True. Actually it sees it as: if ((FirstChoice == 'Coke') or 'Pepsi' or 'Water'): which will always eva

Re: [Tutor] Coding

2014-12-07 Thread Steven D'Aprano
On Mon, Dec 08, 2014 at 01:47:39AM +, Alan Gauld wrote: > > FirstChoice = input ("Enter the item of your choice: ") > > if FirstChoice == 'Coke' or 'Pepsi' or 'Water': > >print ("That will be a total of £",drinks) > > The or statements don't do what you think. > > Python sees it like: >

Re: [Tutor] Coding

2014-12-07 Thread Danny Yoo
On Sun, Dec 7, 2014 at 7:27 AM, Awais Idris <2010-3...@slougheton.com> wrote: > Hi there, I'm currently in secondary school yr 11 studying the computing > course and I've been set a task in creating a vending machine code. I found > some coding online and I have changed some of it, but it still doe

Re: [Tutor] Coding

2014-12-07 Thread Alan Gauld
On 07/12/14 15:27, Awais Idris wrote: found some coding online and I have changed some of it, but it still doesn't work. I think theres a problem with the loops and a few other things that I cant put my finger on. First, Please post the code into your message rather than as an attachment. Its

[Tutor] Coding

2014-12-07 Thread Awais Idris
Hi there, I'm currently in secondary school yr 11 studying the computing course and I've been set a task in creating a vending machine code. I found some coding online and I have changed some of it, but it still doesn't work. I think theres a problem with the loops and a few other things that I can

Re: [Tutor] Coding for a Secret Message in a Game

2013-12-14 Thread Sky blaze
Thank you for the answers! Unfortunately, I haven't had the time to test them out, but these answers make a lot of sense, and I'm sure they'd work. Again, thanks! *See ya!* -Skyblaze101 On Fri, Dec 13, 2013 at 2:20 PM, Danny Yoo wrote: > Whoops, made a small typo in the program I

Re: [Tutor] Coding for a Secret Message in a Game

2013-12-13 Thread Danny Yoo
Whoops, made a small typo in the program I sent. Let me rewrite again: ### def GetFailureMessage(failure_count): """Returns a message given how many times we've seen failure.""" if failure_count <= 1: return "Try again"

Re: [Tutor] Coding for a Secret Message in a Game

2013-12-13 Thread Danny Yoo
As you've just started Python, you may not know about functions yet, but the question you're asking sounds very much like one that a function will help with. You can design functions that do a specific job: in this case, it sounds like you're asking for a function that takes the number of failures

Re: [Tutor] Coding for a Secret Message in a Game

2013-12-13 Thread spir
On 12/13/2013 05:10 AM, Sky blaze wrote: Hi, I'm a newbie Python programmer. I was introduced to Python via the Hour of Code, and after completing all three of Grok Learning's tutorials, I was inspired to create a text-based RPG adventure. I composed this e-mail after searching for a forum for Py

Re: [Tutor] Coding for a Secret Message in a Game

2013-12-13 Thread Steven D'Aprano
On Thu, Dec 12, 2013 at 11:10:31PM -0500, Sky blaze wrote: > Here's the code I currently have so far: > print("===INSTRUCTIONS===") > input(">> ") Are you using Python 3? Is so, that's fine, but in Python 2 you should use raw_input instead. > print("When you see a \'>>\', hit Enter to advance t

Re: [Tutor] Coding for a Secret Message in a Game

2013-12-13 Thread Chris “Kwpolska” Warrick
On Fri, Dec 13, 2013 at 5:10 AM, Sky blaze wrote: > Hi, I'm a newbie Python programmer. I was introduced to Python via the Hour > of Code, and after completing all three of Grok Learning's tutorials, I was > inspired to create a text-based RPG adventure. I composed this e-mail after > searching fo

[Tutor] Coding for a Secret Message in a Game

2013-12-13 Thread Sky blaze
Hi, I'm a newbie Python programmer. I was introduced to Python via the Hour of Code, and after completing all three of Grok Learning's tutorials, I was inspired to create a text-based RPG adventure. I composed this e-mail after searching for a forum for Python, and this address showed up in one of

Re: [Tutor] Coding Challenges

2012-05-21 Thread Bod Soutar
Pop onto http://ubuntuforums.org and find the programming talk sub-forum. One of the stickies there is an index of beginner programming challenges. It's a rolling process where the winner of the previous challenge posts a new one and then picks a winning entry who goes on to post the next challenge

Re: [Tutor] Coding Challenges

2012-05-21 Thread Chris Fuller
On Monday 21 May 2012, Martin A. Brown wrote: > Hello, > > : Being new to programming, I've found that my learning is > : accelerated when I've been asked to write scripts and deliver > : them in a specified time frame...Then, have those scripts > : critiqued. > : > : My question: Would the

Re: [Tutor] Coding Challenges

2012-05-21 Thread Martin A. Brown
Hello, : Being new to programming, I've found that my learning is : accelerated when I've been asked to write scripts and deliver : them in a specified time frame...Then, have those scripts : critiqued. : : My question: Would the moderators of this list be interested in : creating a mo

Re: [Tutor] Coding Challenges

2012-05-21 Thread wolfrage8...@gmail.com
On Mon, May 21, 2012 at 4:47 PM, Malcolm Newsome wrote: > Hey all, > > Being new to programming, I've found that my learning is accelerated when > I've been asked to write scripts and deliver them in a specified time > frame...Then, have those scripts critiqued. > > My question: Would the moderato

[Tutor] Coding Challenges

2012-05-21 Thread Malcolm Newsome
Hey all, Being new to programming, I've found that my learning is accelerated when I've been asked to write scripts and deliver them in a specified time frame...Then, have those scripts critiqued. My question: Would the moderators of this list be interested in creating a monthly "challenge" of so

Re: [Tutor] Coding for AP configuration

2007-02-05 Thread Alan Gauld
"govind goyal" <[EMAIL PROTECTED]> wrote > I am a beginner in python.I am working as S/W tester relating to > WI-FI Welcome. > testing where we've to manually configure Access points(AP). > I want to write a Automated Scripts to configure my AP through HTTP. > Can any body suggest basic coding

Re: [Tutor] Coding for AP configuration

2007-02-05 Thread Kent Johnson
govind goyal wrote: > Hello, > > I am a beginner in python.I am working as S/W tester relating to WI-FI > testing where we've to manually configure Access points(AP). > I want to write a Automated Scripts to configure my AP through HTTP. > Can any body suggest basic coding for this? You can use

Re: [Tutor] Coding for AP configuration

2007-02-05 Thread Christopher Arndt
govind goyal schrieb: > I want to write a Automated Scripts to configure my AP through HTTP. > Can any body suggest basic coding for this? Search the cheeseshop [1] for mechanoid and mechanize. Chris [1] http://cheeseshop.python.org/pypi/ ___ Tutor ma

[Tutor] Coding for AP configuration

2007-02-05 Thread govind goyal
Hello, I am a beginner in python.I am working as S/W tester relating to WI-FI testing where we've to manually configure Access points(AP). I want to write a Automated Scripts to configure my AP through HTTP. Can any body suggest basic coding for this? Thanks. Best Regards, Govind Goyal _