Question: i am really beginner and just starting programming with python since 2 weeks.
here is my question i cant find anywhere or i cant figure out the solution.
i want to see my result in terminal with multiple line , for example i want to calculate long for loop and the result show up this loop on terminal with very long a single line.
is there any solution for this?
and sorry for my bad english isnt my native language.

**Code:**

```
list = list(range(1,100))
for x in list:
    if x % 3 == 0 or x % 5 == 0:
        print(x, end=' ')

```

**Output:**

```
3 5 6 9 10 12 15 18 20 21 24 25 etc...

```

But i want this one:

```
3 5 6 9 10
12 15 18 20 21

```

Answer: 
As explained in the [documentation](https://firebase.google.com/docs/functions/callable), to "send data back to the client, return data that can be JSON encoded" and to return errors you should "throw (or return a Promise rejected with) an instance of `functions.https.HttpsError`". 

```
exports.registerUser = functions.https.onCall((data, context) => {
    const userEmail = data.email;
    const userPassword = data.password;

    return admin.auth().createUser({  // See the return here
        email: userEmail,
        emailVerified: false,
        password: userPassword,
        displayName: "name",
        photoURL: "...",
        disabled: false
    })
        .then(userRecord => {
            //want to return messages if succeed or not
            return {
                result: 'success'
            };
        })
        .catch(error => {
            throw new functions.https.HttpsError('invalid-argument', 'message');
        })
});

```

You may use different [error codes](https://firebase.google.com/docs/reference/functions/providers_https_#functionserrorcode), depending on the type of error. See the [doc](https://firebase.google.com/docs/functions/callable#handle_errors).

---

Then, in the client, you need to do as follows:

```
sendData({
    email: userEmail,
    password: userPassword
}).then(function(response) {
   // Read result of the Cloud Function.
   var result = response.data.result;
   // ...
 }).catch(function(error) {
   // Getting the Error details.
   var code = error.code;
   var message = error.message;
   var details = error.details;
   // ...
 });

```
See <https://firebase.google.com/docs/functions/get-started#review_complete_sample_code>

You do something like 

```
exports.registerUser = functions.https.onCall((data, context) => {
const userEmail = data.email;
const userPassword = data.password;

    const userRecord = admin.auth().createUser({
        email: userEmail,
        emailVerified: false,
        password: userPassword,
        displayName: "name",
        photoURL: "...", 
        disabled: false
    })

    // userRecord is promise, not a value
    return userRecord;
   });

```