Is there a way to do a variable assignment inside a function call in python? Something like
curr= []
curr.append(num = num/2)
Nopey. Assignment is a statement. It is not an expression as it is in C derived languages.
I'm pretty certain I remember one of the reasons Python was created was to avoid these abominations, instead preferring readability over supposed cleverness :-)
What, pray tell, is wrong with the following?
curr= []
num = num/2
curr.append(num)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With