On 21/01/2019 00:14, Ello Solcraft wrote:
> # currLocation doesn't use the updated variable.
>
> for x in inputList:
>
> currCalc.append(x)
> currCalc2 = ''.join(currCalc)
> currLocation = mapLocation(mapInput(currCalc2))#mapInput(currCalc2))
You haven't hgiven us any inf
Hi Ello, and welcome!
On Mon, Jan 21, 2019 at 01:14:55AM +0100, Ello Solcraft wrote:
> # currLocation doesn't use the updated variable.
How do you know?
I'm sorry, but it is impossible for me to tell what is going on here.
There simply isn't enough information to understand your code.
We don'
# currLocation doesn't use the updated variable.
for x in inputList:
currCalc.append(x)
currCalc2 = ''.join(currCalc)
currLocation = mapLocation(mapInput(currCalc2))#mapInput(currCalc2))
# I tried printing currCalc2, it updates like it should. But currLocation
doesn't use
Hello David, and welcome!
On Sat, Jan 05, 2019 at 11:18:04AM -0500, David Lynch wrote:
[...]
> From what I've read about functions I should be able to define a function
> with 2 variables? And then I can add all of my code into that function by
> indenting it.
So far so good! Here's an example
On 05/01/2019 16:18, David Lynch wrote:
> Hello,
> I'm not sure if this is where I can find this sort of help but I am
> struggling understanding functions. I have written a simple math code but I
> feel like it could be improved if I were to use it in a function.
You arein the right place and you
Hello,
I'm not sure if this is where I can find this sort of help but I am
struggling understanding functions. I have written a simple math code but I
feel like it could be improved if I were to use it in a function.
>From what I've read about functions I should be able to define a function
with 2
On 25-03-17 11:17, Alan Gauld via Tutor wrote:
method:
print(' '.join(anotherFunction(4))
Many thanks!
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Many thanks!
On 25-03-17 11:17, Alan Gauld via Tutor wrote:
On 25/03/17 10:01, Peter O'Doherty wrote:
def myFunc(num):
for i in range(num):
print(i)
print(myFunc(4))
0
1
2
3
None #why None here?
Because your function does not have an explicit return
value so Python returns it
On Sat, Mar 25, 2017 at 3:31 PM, Peter O'Doherty wrote:
>
> def myFunc(num):
> for i in range(num):
> print(i)
>
> print(myFunc(4))
> 0
> 1
> 2
> 3
> None #why None here?
>
> Because there are two print() functions, one inside the function and
another outside. When a function does not
On 25/03/17 10:01, Peter O'Doherty wrote:
> def myFunc(num):
> for i in range(num):
> print(i)
>
> print(myFunc(4))
> 0
> 1
> 2
> 3
> None #why None here?
Because your function does not have an explicit return
value so Python returns its default value - None.
So the print() inside
Hi,
Apologies for the very basic question but could anyone explain the
behaviour of these two functions (in Python3.5)?
def myFunc(num):
for i in range(num):
print(i)
print(myFunc(4))
0
1
2
3
None #why None here?
def myFunc(num):
for i in range(num):
return i
print(
2017-02-05 9:36 GMT+01:00 Steven D'Aprano :
> On Sat, Feb 04, 2017 at 10:11:39PM -0600, boB Stepp wrote:
>
> > Are the people making linters implementing checking function
> > annotations? Or is this something only gradually being adopted?
>
> Depends which linter :-)
>
> MyPy is still the refere
On Sat, Feb 04, 2017 at 10:11:39PM -0600, boB Stepp wrote:
> Are the people making linters implementing checking function
> annotations? Or is this something only gradually being adopted?
Depends which linter :-)
MyPy is still the reference implementation for type hinting in Python:
http://myp
On Sat, Feb 4, 2017 at 9:23 PM, Steven D'Aprano wrote:
> On Sat, Feb 04, 2017 at 08:50:00PM -0600, boB Stepp wrote:
>> Of course, these are
>> apparently optional. I now wonder if I should be endeavoring to add
>> these to my code?
>
> Do you run a linter? If not, there doesn't seem much point i
On Sat, Feb 04, 2017 at 08:50:00PM -0600, boB Stepp wrote:
> I just finished looking at
> https://docs.python.org/3/tutorial/controlflow.html#function-annotations
> and skimming through PEP 484--Type Hints
> (https://www.python.org/dev/peps/pep-0484/). My initial impression is
> that the purpose o
I just finished looking at
https://docs.python.org/3/tutorial/controlflow.html#function-annotations
and skimming through PEP 484--Type Hints
(https://www.python.org/dev/peps/pep-0484/). My initial impression is
that the purpose of function annotations is to enable static code
analysis tools like l
On Thu, Dec 8, 2016 at 1:11 AM, Alan Gauld via Tutor wrote:
> On 08/12/16 06:04, Palanikumar wrote:
>> #Function Argument unpacking
>> def myfunc(x, y, z):
>> print(x. v. z)
>>
>
> Please always send the actual code that generates
> the error, do not retype as it causes us to chase
> phantom
On 08/12/16 06:04, Palanikumar wrote:
> #Function Argument unpacking
> def myfunc(x, y, z):
> print(x. v. z)
>
Please always send the actual code that generates
the error, do not retype as it causes us to chase
phantom bugs. In this case the fact that the v
in the print statement should be a
Palanikumar wrote:
> File "func.py", line 8
> tuple_vec = {1, 0, 1)
> ^
> SyntaxError: invalid syntax
The opening and the closing parenthesis have to match.
To get a tuple:
tuple_vec = (1, 0, 1)
To get a set (with two values in undefined order, so not a good match
#Function Argument unpacking
def myfunc(x, y, z):
print(x. v. z)
tuple_vec = {1, 0, 1)
dict_vec = {'x':1, 'y':0, 'z':1}
myfunc(*tuple_vec)
myfunc(*dict_vec)
It returns following error
File "func.py", line 8
tuple_vec = {1, 0, 1)
^
SyntaxError: invalid syntax
On 29/04/15 04:58, Jim Mooney Py3winXP wrote:
numbers = []
Note that you chose to make this global.
def parse_string(math_string):
"""Input: A math string with a verbal or mathematical operation
and two valid numbers to operate on. Extra numbers and operations
are ignored. Out
On 28Apr2015 22:27, Jim Mooney Py3winXP wrote:
On 28 April 2015 at 21:27, Cameron Simpson wrote:
At a first glance numbers is a global. It is reset to [] at program start,
but never again. So you're appending to it forever. I have not investigated
further as to how that affects your program's
On 28 April 2015 at 21:27, Cameron Simpson wrote:
> At a first glance numbers is a global. It is reset to [] at program start,
> but never again. So you're appending to it forever. I have not investigated
> further as to how that affects your program's flow.
>
> Cheers,
> Cameron Simpson
>
Took
On 28Apr2015 20:58, Jim Mooney Py3winXP wrote:
This is really puzzling me. I'm parsing a string to do some simple math
operations and practice tossing functions around. My parser works on the
first run, then it continually fails on the same input.
[...]
numbers = []
[...]
def parse_string(m
This is really puzzling me. I'm parsing a string to do some simple math
operations and practice tossing functions around. My parser works on the
first run, then it continually fails on the same input.
"""
Takes the name of a binary math operation and two numbers from input,
repeatedly, and display
On 04/13/2015 08:56 AM, Steven D'Aprano wrote:
On Mon, Apr 13, 2015 at 08:11:46AM -0400, Ken G. wrote:
I am sure there is an simple explanation but when I input
5 (as integer), resulting in 05 (as string), I get zero as the end
result. When running the code:
number01 = 0
Here you set the vari
On Mon, Apr 13, 2015 at 08:11:46AM -0400, Ken G. wrote:
> I am sure there is an simple explanation but when I input
> 5 (as integer), resulting in 05 (as string), I get zero as the end
> result. When running the code:
> number01 = 0
Here you set the variable "number01" to the int 0.
> numberentr
Hello,
In the code that you posted, as it is, you are:
1) defining a function (numberentry)
2) defining a global variable (number01) and setting it to 0
3) calling numberentry discarding the result
4) printing the value of the global variable number01
I would guess that you want to store the resul
Ken G. wrote:
> I am sure there is an simple explanation but when I input
> 5 (as integer), resulting in 05 (as string), I get zero as the end
> result. When running the code:
>
> START OF PROGRAM:
> Enter the 1st number: 5
>
> 05
>
> 0
> END OF PROGRAM:
>
> START OF CODE:
> import sys
>
> d
On 04/13/2015 08:18 AM, Dave Angel wrote:
On 04/13/2015 08:11 AM, Ken G. wrote:
I am sure there is an simple explanation but when I input
5 (as integer), resulting in 05 (as string), I get zero as the end
result. When running the code:
START OF PROGRAM:
Enter the 1st number: 5
05
0
END OF
On 04/13/2015 08:11 AM, Ken G. wrote:
I am sure there is an simple explanation but when I input
5 (as integer), resulting in 05 (as string), I get zero as the end
result. When running the code:
START OF PROGRAM:
Enter the 1st number: 5
05
0
END OF PROGRAM:
START OF CODE:
import sys
def numb
I am sure there is an simple explanation but when I input
5 (as integer), resulting in 05 (as string), I get zero as the end
result. When running the code:
START OF PROGRAM:
Enter the 1st number: 5
05
0
END OF PROGRAM:
START OF CODE:
import sys
def numberentry():
print
number01 = raw
Scott W Dunning wrote:
>
> On Feb 23, 2014, at 2:26 AM, Peter Otten <__pete...@web.de> wrote:
>> If you want to make rows with more or less stars, or stars in other
>> colors you could add parameters:
>>
>> def star_row(numstars, starcolor):
>>for i in range(numstars):
>>fillstar(sta
On 24/02/14 02:04, Scott W Dunning wrote:
*Also, does anyone know anything about turtle where I can try and move
the starting point to the upper left hand corner? *
dir() and help() are your friends.
After doing dir(turtle) I spooted this likely looking candidate and ran
help on it:
---
On Feb 23, 2014, at 2:26 AM, Peter Otten <__pete...@web.de> wrote:
> which still shows a repetetive pattern and thus you can simplify it with
> another loop. You should be able to find a way to write that loop with two
> star_row() calls on a single iteration, but can you do it with a single call
On Feb 23, 2014, at 2:26 AM, Peter Otten <__pete...@web.de> wrote:
> If you want to make rows with more or less stars, or stars in other colors
> you could add parameters:
>
> def star_row(numstars, starcolor):
>for i in range(numstars):
>fillstar(starcolor)
>space(25)
>
> Y
On Feb 23, 2014, at 2:26 AM, Peter Otten <__pete...@web.de> wrote
> a programmer would think "for loop” immediately
That’s what I thought. It just seemed like way to much to keep repeating
everything over and over. I knew there had to be a better way we just haven’t
learned loops in school yet.
On Feb 23, 2014, at 5:31 AM, Dave Angel wrote:
>
> Welcome to the tutor forum also, Scott. You'll find it works very
> similarly to python-list, and has many of the same people on it.
> I'm not sure how you tried to attach source, but please be aware
> that this is a text list - anything othe
Scott W Dunning Wrote in message:
> I am VERY new to python (programming too). I had a question regarding
> functions. Is there a way to call a function multiple times without
> recalling it over and over. Meaning is there a way I can call a function and
> then add *5 or something like that
Scott W Dunning writes:
> I am VERY new to python (programming too).
Welcome!
You should establish the fundamentals of Python, by working through the
Python tutorial http://docs.python.org/3/tutorial/>.
Begin at the beginning, and execute all the examples, and experiment
with them to satisfy y
Scott W Dunning wrote:
>
> On Feb 23, 2014, at 1:12 AM, Scott W Dunning wrote:
>
>> I am VERY new to python (programming too). I had a question regarding
>> functions. Is there a way to call a function multiple times without
>> recalling it over and over. Meaning is there a way I can call a
On Feb 23, 2014, at 1:12 AM, Scott W Dunning wrote:
> I am VERY new to python (programming too). I had a question regarding
> functions. Is there a way to call a function multiple times without
> recalling it over and over. Meaning is there a way I can call a function and
> then add *5 or
I am VERY new to python (programming too). I had a question regarding
functions. Is there a way to call a function multiple times without recalling
it over and over. Meaning is there a way I can call a function and then add *5
or something like that? I am trying to code an American Flag usin
On 30/09/13 01:13, Sammy Cornet wrote:
Greets!!
Your help provided to me concerning function definition
> was awesome Steven. Gratitude...!!!
I'm not sure who's tongue is furthest into their cheek here.
But please, in future show us some code and any error
messages, it does make it easier to a
Greets!!
Your help provided to me concerning function definition was awesome Steven.
Gratitude...!!!
Sent from my iPhone
On Sep 28, 2013, at 9:56, "Steven D'Aprano" wrote:
> On Sat, Sep 28, 2013 at 10:19:57AM -0500, Sammy Cornet wrote:
>> Hello!
>> I'm using python v2.7.5 (IDLE). I'm trying t
On 28/9/2013 11:19, Sammy Cornet wrote:
> Hello!
> I'm using python v2.7.5 (IDLE). I'm trying to write a nine_line function that
> should use three_lines to print nine blanc lines. For some reason, I only
> print one line. Can you please provide me with some explanation? I would be
> very grate
On Sat, Sep 28, 2013 at 10:19:57AM -0500, Sammy Cornet wrote:
> Hello!
> I'm using python v2.7.5 (IDLE). I'm trying to write a nine_line
> function that should use three_lines to print nine blanc lines. For
> some reason, I only print one line. Can you please provide me with
> some explanation?
Hello!
I'm using python v2.7.5 (IDLE). I'm trying to write a nine_line function that
should use three_lines to print nine blanc lines. For some reason, I only print
one line. Can you please provide me with some explanation? I would be very
grateful!
__
On 24/06/13 18:12, John Steedman wrote:
Hi Tutors,
I'm confused by the following possible contradiction. Would someone please
explain or point me to the right docs.
[snip confusion about parameter passing and Python's object model]
By FACT 1 x should be a reference parameter...?
By Fact 2 x
Thanks for all these clear and knowledgeable answers. I'm much clearer on
this now and will read up a bit more around these subjects.
John
On Mon, Jun 24, 2013 at 10:59 AM, Peter Otten <__pete...@web.de> wrote:
> John Steedman wrote:
>
> > Hi Tutors,
> >
> > I'm confused by the following possi
John Steedman wrote:
> Hi Tutors,
>
> I'm confused by the following possible contradiction. Would someone please
> explain or point me to the right docs.
>
> FACT 1
>
> "Variables in python hold references to objects."
> http://en.wikipedia.org/wiki/Python_syntax_and_semantics
>
> FACT 2
>
>>
On 06/24/2013 04:12 AM, John Steedman wrote:
Hi Tutors,
I'm confused by the following possible contradiction. Would someone please
explain or point me to the right docs.
FACT 1
"Variables in python hold references to objects."
http://en.wikipedia.org/wiki/Python_syntax_and_semantics
FACT 2
Hi Tutors,
I'm confused by the following possible contradiction. Would someone please
explain or point me to the right docs.
FACT 1
"Variables in python hold references to objects."
http://en.wikipedia.org/wiki/Python_syntax_and_semantics
FACT 2
>>>def Increment ( x ) :
>>>// return x + 1
Hello Petter!!
Thank you for answer to my question. I apologize for the writing of my code,
won't happen again. I added the lines you suggested me, and the script work
fine. Than you!! Here's the code corrected and indented.
from Tkinter import * #Llamo las librerias graficas de Tk
import tkSimple
Susana Iraiis Delgado Rodriguez wrote:
Susana, please use 4-space indents for your code samples. I've said it
before, but I think it's worthwhile repeating because it makes it much
easier to grasp the structure of a script at first sight.
> But now I get a differente error, this script is going
Hello guys!!!
Shame on me, you're rigth I missunderstood the function and the module.
I change the name of my function and that part of my code worked.
But now I get a differente error, this script is going to collect
information from shapefiles, I asked the user where to start the search, the
file
Hi Susana,
On 5 September 2011 17:08, Susana Iraiis Delgado Rodriguez <
susana.delgad...@utzmg.edu.mx> wrote:
> File "win.py", line 43, in boton4
> writer = csv.writer(open(csv_name, 'w'))
> AttributeError: 'function' object has no attribute 'writer'
> I read a tutorial and csv has a writer
On Mon, Sep 5, 2011 at 12:08 PM, Susana Iraiis Delgado Rodriguez <
susana.delgad...@utzmg.edu.mx> wrote:
> I want to write a csv file, but I need the final user to give me some
> values to open and update the file. My code is:
> from Tkinter import * #Llamo las librerias graficas de Tk
> import tk
I want to write a csv file, but I need the final user to give me some values
to open and update the file. My code is:
from Tkinter import * #Llamo las librerias graficas de Tk
import tkSimpleDialog #Libreria de almacenamiento de dialogos
import tkMessageBox #Libreria de mensajes
import tkFileDialog
Robert Johansson wrote:
> This is my attempt to generate all pairs of relatively prime pairs of
> nonnegative integers (n, m) such that n + m <= N, using the Stern-Brocot
> tree.
>
> def rp_bounded_sum(n, i = 0, p = (0, 1), q = (1, 1), S = set([(0, 1), (1,
> 1)])):
> # Returns a set S with al
On 09/08/11 08:44, Robert Johansson wrote:
def rp_bounded_sum(n, i = 0, p = (0, 1), q = (1, 1), S = set([(0, 1),
(1, 1)])):
Strangely, (to me) it seems that the function remembers the set S
between different calls:
That's correct. Python evaluates the default parameter value once at
functi
Hi all,
This is my attempt to generate all pairs of relatively prime pairs of
nonnegative integers (n, m) such that n + m <= N, using the Stern-Brocot tree.
def rp_bounded_sum(n, i = 0, p = (0, 1), q = (1, 1), S = set([(0, 1), (1, 1)])):
# Returns a set S with all relatively prime pairs (a,
Ashley F wrote:
ok...here's the function I've written so far.
def padWithGaps(seq):
for letter in seq:
letter="-"
line=len(seq)
dashline=line*letter
return dashline
I don't think that's a useful function. It seems to do a HUGE amount of
work that just keeps get
I'm not sure of the answer to your question, because i'm not sure I
understand it. Perhaps you could rephrase it?
But, there is some other stuff I noticed though:
def padWithGaps(seq):
for letter in seq:
letter="-"
line=len(seq)
dashline=line*letter
return dashli
ok...here's the function I've written so far.
def padWithGaps(seq):
for letter in seq:
letter="-"
line=len(seq)
dashline=line*letter
return dashline
def replace(someString,position,letter):
first=someString[0:position]
second=letter
third=someString[posi
> ##
> import turtle, random
>
> def checkForward(distance):
> old_position = turtle.position()
> turtle._pen.up()
> turtle.forward(distance)
> forward_failed = outOfBounds()
you set forward faile
On Sat, Oct 2, 2010 at 7:45 PM, Steve Willoughby wrote:
> On 02-Oct-10 10:32, Emile van Sebille wrote:
>>>
>>> File "my_turtle.py", line 19
>>> if (abs(turtle.position()[0])> turtle.window_height()/2) or
>>> ^
>>> SyntaxError: invalid syntax
>
> How does Python know that the next line is the conti
On 10/2/2010 10:45 AM Steve Willoughby said...
On 02-Oct-10 10:32, Emile van Sebille wrote:
Well, not really -- this is the OPs code. I was responding to Joel's
comment of not seeing the entire post.
File "my_turtle.py", line 19
if (abs(turtle.position()[0]) > turtle.window_height()/2) or
On 02-Oct-10 10:32, Emile van Sebille wrote:
File "my_turtle.py", line 19
if (abs(turtle.position()[0])> turtle.window_height()/2) or
^
SyntaxError: invalid syntax
How does Python know that the next line is the continuation of your if
statement, instead of the beginning of a new line of code?
On 10/2/2010 10:16 AM Joel Goldstick said...
##
import turtle, random
def checkForward(distance):
old_position = turtle.position()
turtle._pen.up()
# no show/hide turtle methods in my turtle modul
On Sat, Oct 2, 2010 at 12:43 PM, roberto wrote:
> On Thu, Sep 30, 2010 at 1:45 PM, ALAN GAULD wrote:
>> Copy the code into a text file with a name ending in .py - lets call it
>> myfile.py for now
>> (if you have not already done so)
>>
>> From a bash prompt type
>>
>> $ python myfile.py
>>
>> Th
On Thu, Sep 30, 2010 at 1:45 PM, ALAN GAULD wrote:
> Copy the code into a text file with a name ending in .py - lets call it
> myfile.py for now
> (if you have not already done so)
>
> From a bash prompt type
>
> $ python myfile.py
>
> Then cut n paste any error messages into an email to the list
ttp://www.alan-g.me.uk/
- Original Message
> From: roberto
> To: Alan Gauld
> Cc: tutor@python.org
> Sent: Thursday, 30 September, 2010 10:02:51
> Subject: Re: [Tutor] function error
>
> On Wed, Sep 29, 2010 at 11:13 PM, Alan Gauld
>wrote:
> >
> >
On Wed, Sep 29, 2010 at 11:13 PM, Alan Gauld wrote:
>
> OK, Thats a non standard error trace so presumably you are running it inside
> an IDE of some kind? It may be the IDE is masking the true error.
> What happens if you just execute the code from a shell prompt in a console
> window? Can you s
"roberto" wrote
Perhaps if you provide the full traceback from the error
here it is:
TypeError Traceback (most recent
call last)
~/randomMove2.py in ()
> 1
2
3
4
5
...
~/checkForward.py in out_of_bounds()
19
20 def outOfBo
>> Perhaps if you provide the full traceback from the error (assuming you're
>> still getting this >error); tracebacks generally show the offending code as
>> well. It may be something that's >simply overlooked but shows in the
>> traceback.
>>
>>
>
> here it is:
>
> TypeError
On Tue, Sep 28, 2010 at 8:26 PM, Evert Rol wrote:
>
> Perhaps if you provide the full traceback from the error (assuming you're
> still getting this >error); tracebacks generally show the offending code as
> well. It may be something that's >simply overlooked but shows in the
> traceback.
>
>
>> It seems that ur turtle.position doesn't return a list because of this when
>> indexing is done on that u get this kind of error.
>> --nitin
>
> it seemed to me that kind of error but then i found that it was a
> list, as expected:
>
> $ type(turtle.position())
> $
> $ abs(turtle.position()[
On Tue, Sep 28, 2010 at 12:35 PM, Nitin Das wrote:
> It seems that ur turtle.position doesn't return a list because of this when
> indexing is done on that u get this kind of error.
> --nitin
it seemed to me that kind of error but then i found that it was a
list, as expected:
$ type(turtle.posi
It seems that ur turtle.position doesn't return a list because of this when
indexing is done on that u get this kind of error.
--nitin
On Tue, Sep 28, 2010 at 3:39 PM, Alan Gauld wrote:
>
> "roberto" wrote
>
>
> i have the following error when i call this function:
>> 20 def outOfBounds():
>>
"roberto" wrote
i have the following error when i call this function:
20 def outOfBounds():
---> 21 if abs(turtle.position()[0]) >
turtle.window_height()/2 or abs(turtle.position()[1]) >
turtle.window_width()/2:
22 return "true"
23 else:
TypeError: 'f
hello,
i have the following error when i call this function:
20 def outOfBounds():
---> 21 if abs(turtle.position()[0]) >
turtle.window_height()/2 or abs(turtle.position()[1]) >
turtle.window_width()/2:
22 return "true"
23 else:
TypeError: 'function' ob
On Tue, 28 Sep 2010 01:09:54 am Tim Miller wrote:
> def complex_password(password):
> """Checks password for sufficient complexity."""
> if len(password) < 12:
> return False
> if len([c for c in password if c in punctuation]) == 0:
> return False
> if len([c
On 28/09/10 01:50, Brian Jones wrote:
On Mon, Sep 27, 2010 at 11:43 AM, Brian Jones mailto:bkjo...@gmail.com>> wrote:
How about this:
d = [digits, punctuation, ascii_uppercase, ascii_lowercase]
s = 'asdf1234A'
for c in d:
if not [x for x in s if x in c]:
print x, ' not in ', c
Ju
On 28/09/10 01:46, Jerry Hill wrote:
The way you've written it obviously works fine. That being said, I'd
probably do something like this:
from string import ascii_lowercase, ascii_uppercase, digits, punctuation
def complex_password(password):
'''Checks to make sure a password is complex'
set does seem to have what you want: isdisjoint() could do the trick.
Eg:
if set(punctuation).isdisjoint(password) or
set(digits).isdisjoint(password) or set(ascii_uppercase).isdisjoint(password)
or set(ascii_lowercase).isdisjoint(password):
return False
return True
You co
> I've got a small function that I'm using to check whether a password is of a
> certain length and contains mixed case, numbers and punctuation.
>
> Originally I was using multiple "if re.search" for the patterns but it looked
> terrible so I've read up on list comprehensions and it's slightly
On Mon, Sep 27, 2010 at 11:43 AM, Brian Jones wrote:
>
>
> On Mon, Sep 27, 2010 at 11:09 AM, Tim Miller wrote:
>
>> I've got a small function that I'm using to check whether a password is of
>> a certain length and contains mixed case, numbers and punctuation.
>>
>> Originally I was using multip
On Mon, Sep 27, 2010 at 11:09 AM, Tim Miller wrote:
> I've got a small function that I'm using to check whether a password is of a
> certain length and contains mixed case, numbers and punctuation.
>
> Originally I was using multiple "if re.search" for the patterns but it
> looked terrible so I've
On Mon, Sep 27, 2010 at 11:09 AM, Tim Miller wrote:
> I've got a small function that I'm using to check whether a password is of
> a certain length and contains mixed case, numbers and punctuation.
>
> Originally I was using multiple "if re.search" for the patterns but it
> looked terrible so I'v
I've got a small function that I'm using to check whether a password is
of a certain length and contains mixed case, numbers and punctuation.
Originally I was using multiple "if re.search" for the patterns but it
looked terrible so I've read up on list comprehensions and it's slightly
improved
Thank you. This will be printed out and studied. Amazing of what
Python can do.
Ken
On 09/17/2010 06:10 PM, bob gailer wrote:
On 9/16/2010 8:18 AM, Ken Green wrote:
I am unclear on the behavior of using a function. Below is a short
code I wrote to print an amount out after inputting the n
On 9/16/2010 8:18 AM, Ken Green wrote:
I am unclear on the behavior of using a function. Below is a short
code I wrote to print an amount out after inputting the number of match.
# TEST Function.py
def change(amount):
if match == 1:
amount = 0
if match == 2:
amount =
Thanks Alan. With suggestion and help from several other people on the
list, I was able to solve the problem. I learned from an example
previously given. I am using several different tutorials and I have
yours bookmarked.
Ken
On 09/16/2010 05:26 PM, Alan Gauld wrote:
"Ken Green" wrote
"Ken Green" wrote
I am unclear on the behavior of using a function.
You certainly are!
Which tutorial are you working from?
You have several fundamental errors here, its hard to know
where to start.
def change(amount):
if match == 1:
amount = 0
if match == 2:
amount
> I am unclear on the behavior of using a function. Below is a short code I
> wrote to print an amount out after inputting the number of match.
>
> # TEST Function.py
>
> def change(amount):
>if match == 1:
>amount = 0
>if match == 2:
>amount = 0
>if match == 3:
>
On Thu, Sep 16, 2010 at 08:18:45AM -0400, Ken Green
wrote:
> I am unclear on the behavior of using a function. Below is a short
> code I wrote to print an amount out after inputting the number of
> match.
>
> # TEST Function.py
>
> def change(amount):
> if match == 1:
> amount = 0
I am unclear on the behavior of using a function. Below is a short code
I wrote to print an amount out after inputting the number of match.
# TEST Function.py
def change(amount):
if match == 1:
amount = 0
if match == 2:
amount = 0
if match == 3:
amount = 3
What can I say except, thanks so much everyone for taking your time and
writing me an explication. I finally understood what function objects are.
Thanks, really thanks for helping me out. I wish everyone the best.
___
Tutor maillist - Tutor@python.org
Daniel,
Considering that Python is your first programming language, let's start
from the absolute beginning. Before you think about what a function object
is, try to understand what a function is. A function is a series of
python commands put together under a common heading or name in order
1 - 100 of 188 matches
Mail list logo