'Gandhi's teachings helped Barack Obama shape his life'