Re: [Tutor] Help with program

2015-02-16 Thread Dave Angel
On 02/16/2015 11:27 AM, Courtney Skinner wrote: Hello, I am trying to build a program that approximates the value of cosine - this is my program so far. It is not returning the right values. Could you tell me what I am doing wrong? You've got several answers that point out several problems

Re: [Tutor] Help with program

2015-02-16 Thread Peter Otten
Courtney Skinner wrote: > Hello, > > I am trying to build a program that approximates the value of cosine - > this is my program so far. It is not returning the right values. Could you > tell me what I am doing wrong? > > > def main(): > > import math > > print("This program appro

Re: [Tutor] Help with program

2015-02-16 Thread Alan Gauld
On 16/02/15 16:27, Courtney Skinner wrote: Hello, I am trying to build a program that approximates the value of cosine def main(): import math Its usual to do the imports outside the function at the tyop of the file. Python doesn't actually care much but its 'standard practice'.

Re: [Tutor] Help with program

2015-02-16 Thread Mark Lawrence
On 16/02/2015 16:27, Courtney Skinner wrote: Hello, I am trying to build a program that approximates the value of cosine - this is my program so far. It is not returning the right values. Could you tell me what I am doing wrong? def main(): import math Not that it matters but imports

Re: [Tutor] help with program from learning python the hard way

2012-01-19 Thread Walter Prins
Hi Jason, On 19 January 2012 13:02, Jason Loeve wrote: > good day i seem to be stuck, my code is > > from sys import argv > > script, user_name = argv > > and i get an error ValueError: need more than 1 value to unpack > The implication of this message is that the value of "argv" contains only

Re: [Tutor] help with program from learning python the hard way

2012-01-19 Thread bodsda
If I say that sys.argv is a list, does that help you? Also, run things from a command prompt for this kind of thing, at least then you can guarantee what args get passed Bodsda Sent from my BlackBerry® wireless device -Original Message- From: Jason Loeve Sender: tutor-bounces+bodsda

Re: [Tutor] help with program from learning python the hard way

2012-01-19 Thread vishwajeet singh
On Thu, Jan 19, 2012 at 6:32 PM, Jason Loeve wrote: > good day i seem to be stuck, my code is > > from sys import argv > > script, user_name = argv > Are you passing an additional parameter while executing the script ?? you must execute it passing an additional parameter which will get assigned