I have some code that might return either a single int, or a list. When it returns an int, I need to convert it into a list that contains only the int.
I tried the following, but it doesn’t work:
newValue = list(retValue)
Apparently I can’t do list(some int) because ints are not iterable. Is there another way of doing this?
Thanks in advance!
define your own function: