[Tutor] Function not using updated variable?

Alan Gauld alan.gauld at yahoo.co.uk
Mon Jan 21 03:13:37 EST 2019


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 information that would help us diagnose the
problem. All we can say from this is that you are passing the correct
variable to mapInput().

But what does mapUInput() do? Show us that code too.

And what does mapLocation do with the return value from mapInput()?
We need to see that code too.


> ... Hoewer it does work if I input a string
> without the currLocation variable.

That probably makes sense to you but makes no sense to us.
How can it "work" if you remove the variable that you
are saying doesn't work?

Maybe you need to explain what you are trying to achieve?

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list