[Tutor] quick function variable
Alan Gauld
alan.gauld at yahoo.co.uk
Tue Feb 8 19:54:42 EST 2022
On 09/02/2022 00:02, Nathan Smith wrote:
> def func(name="bob", lastname="bobland", chicken="soup"):
> How could I do this in variables?
>
> EG:
>
> variable_change="name"
> value="Bob"
> func(variable_change=value)
I have no idea!
but I suspect if there is a way, the answer might lie in
the functools module, so that might be worthy of some study.
Just a guess!
--
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