return-type tag

1 questions


2 answers
90 views
0
The right way to do it when multiple return types of Python functions are required?

I need a function that changes the return type according to the conditions as follows.def get_info(command): if command == 'List': result = [1,2,3,4,5] elif command == 'Number': result = 3 elif comm...

1 years ago

© 2024 OneMinuteCode. All rights reserved.