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

[Tutor] Help with program

2015-02-16 Thread Courtney Skinner
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 approximates the cosine of x by summing") print(

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
+bodsda=googlemail@python.org Date: Thu, 19 Jan 2012 15:02:41 To: Subject: [Tutor] help with program from learning python the hard way ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman

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

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

2012-01-19 Thread Jason Loeve
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 http://learnpythonthehardway.org/book/ex14.html i am using PyCharm 1.5.4 to run thanks in advance jason ___