On 4/28/2014 11:45 AM, taserian wrote:
Is there some sort of rule-of-thumb to determine if a function is
in-place or returns a value?
my rule of thumb is to ask:
Python 2.7.5 (default, May 15 2013, 22:44:16)
[MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license
Hi Antonio,
Unfortunately, I don't think it's apparent whether or not a function
applies mutations or is a pure computation. In Python, those are by
convention or documentation rather than part of the language. There
are other programming languages can control the effects and scope of
mutation,
On Sat, Apr 26, 2014 at 03:53:33PM -0700, jordan smallwood wrote:
> Hello,
>
> I am new to Python. I mean completely new and we're working on this
> problem set in class where they give us specs and we have to build
> something based off these specs. I have no idea what they're asking.
> Could
I can't claim to be new to programming, but I've dabbled in Python over and
over again to get small problems and puzzles resolved. One thing that I
find I can't keep straight are the methods that change a list in place, vs.
those that return a copy (sometimes transformed) of the list.
Call me old-
Hi Jordan,
You probably want to read up to chapter 3 (including the "Functions"
chapter) in "How to Think Like a Computer Scientist":
http://www.greenteapress.com/thinkpython/html/index.html
or some equivalent tutorial, so that you at least know what the terms
in the problem statement means.
On Mon, Apr 28, 2014 at 01:49:31PM -0400, C Smith wrote:
> That is definitely more useful information in answering your questions.
> Whenever you see the error you are getting:
>
> NameError: name 'smv_guessNumber' is not defined
>
> That means you are using a variable, in this case 'smv_guessNum
On Mon, Apr 28, 2014 at 01:50:56PM -0400, C Smith wrote:
> I should probably clarify that this list is mainly for python2.7, correct
> me if I am wrong.
Nope, any version of Python. If anyone is silly enough to be using
Python 0.9 (which is over 20 years old!) I can try to answer their
questions
On Mon, Apr 28, 2014 at 10:32:06AM -0700, Stephen Mik wrote:
> I must be doing something very wrong. The program is supposed to
> run a main loop ,for control of the program. The program DOES print
> out the prompts before the While Loop, but when it comes to a variable
> named"smv_guessNum
>
> The reason this is happening here is you need to import sys.
>
I don't know why you would think importing sys would fix this.
docs say it accepts from sys.stdin
I now see that it is not necessary to import sys, although I am not sure
why.
On Mon, Apr 28, 2014 at 1:59
The reason this is happening here is you need to import sys.
>
I don't know why you would think importing sys would fix this.
docs say it accepts from sys.stdin
On Mon, Apr 28, 2014 at 1:55 PM, Philip Dexter wrote:
>
>
> On Mon, 28 Apr 2014, C Smith wrote:
>
> I should probably clar
Stephen Mik wrote:
> My program, Assignment4,does run partially. You can see the results of the
> Python Shell attached to this email. I also have included part of my code
> for your perusal.
>
> I must be doing something very wrong. The program is supposed to run a
> main loop ,for control of th
I should probably clarify that this list is mainly for python2.7, correct
me if I am wrong.
On Mon, Apr 28, 2014 at 1:49 PM, C Smith wrote:
> That is definitely more useful information in answering your questions.
> Whenever you see the error you are getting:
>
> NameError: name 'smv_guessNumber
That is definitely more useful information in answering your questions.
Whenever you see the error you are getting:
NameError: name 'smv_guessNumber' is not defined
That means you are using a variable, in this case 'smv_guessNumber', that
has not been created yet.
The reason this is happening he
Dear Python Tutor:
Well,I am Stephen Mik,and I'm a beginning,rookie programmer who is just
trying to get a class Assignment going. The instructor of my class does not
accept email and she is not on Campus on Monday. So,my only recourse is to turn
to Python Tutor for assistance.
My progr
.split() will split things based on whitespace or newlines. Do you know
that your file is only going to contain things that should convert to
floats? If you post your entire code, the error you have included will be
more helpful as it points to a certain line. The last line in your code has
(stri)
On Apr 28, 2014 11:14 AM, "Gabriele Brambilla" <
gb.gabrielebrambi...@gmail.com> wrote:
>
> Hi,
>
> I'm trying to convert a string to a float. It seems a basic thing but I
don't know why I'm getting this erroris
>
> Traceback (most recent call last):
> File "phresREADER.py", line 27, in
> tr
solved, sorry for the disturb
http://stackoverflow.com/questions/23344345/strings-not-converting-to-float-as-expected/23344830#23344830
bye
Gabriele
2014-04-28 11:13 GMT-04:00 Gabriele Brambilla <
gb.gabrielebrambi...@gmail.com>:
> Hi,
>
> I'm trying to convert a string to a float. It seems a
Hi,
I'm trying to convert a string to a float. It seems a basic thing but I
don't know why I'm getting this erroris
Traceback (most recent call last):
File "phresREADER.py", line 27, in
tra = float(stri)
ValueError: could not convert string to float:
My file has this line
5.5e+000 5.
> 1. Write a program module with at least two functions.
Hint: "def" is the Python keyword used to define a function. You can
read all about def in the docs on python.org.
Alan
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscripti
On 26/04/2014 23:53, jordan smallwood wrote:
Hello,
I am new to Python. I mean completely new and we're working on this
problem set in class where they give us specs and we have to build
something based off these specs. I have no idea what they're asking.
Could someone help get me started on the
Hello,
I am new to Python. I mean completely new and we're working on this problem set
in class where they give us specs and we have to build something based off
these specs. I have no idea what they're asking. Could someone help get me
started on the path to figuring this out?
Below is the qu
21 matches
Mail list logo