How to return multiple value from function ?

Firmware/software/electronics/mechanics
Post Reply
chonchonchon
Beginner
Posts: 18
Joined: Sat Sep 20, 2014 1:47 am

How to return multiple value from function ?

Post by chonchonchon »

Hi,

I've a function that return 3 values. (A,b,c).

Actually, I'm using global variables to save them and acces them back in the main script.

How can I return these variables without need of global var?

Thx for your help
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: How to return multiple value from function ?

Post by chad »

Python? Use tuples or lists... Global variables are generally not a good coding practice.
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
Post Reply