Question: I'm currently experimenting with Parse Cloud Functions.  

The following simple example already worked well:

```js
Parse.Cloud.define("hello", async (request) => {
    return "Hi " + request.params.name;
});

```

---

In my apps I login as a user before making any request so I want to restrict access to this function by objectId of the user.  

The docs give the following example for validation:

```js
requireUserKeys: {
    accType : {
      options: 'reviewer',
      error: 'Only reviewers can get average stars'
    }
  }

```

So I added this validation to my request (and I require masterKey for validation as normal users are not allowed to read User objects):

[![documentation](https://i.stack.imgur.com/cilVb.png)](https://i.stack.imgur.com/cilVb.png)

```js
Parse.Cloud.define("hello", async (request) => {
    return "Hi " + request.params.name;
}, {
    validateMasterKey: true,
    requireUserKeys: {
        objectId: {
            options: "ABCD1234", // dummy id
            error: "Unauthorized"
        }
    }
});

```

---

If I now make a request as the logged in user with the objectId "ABCD1234" I get the error message "Unauthorized", so the validation does not work as intended.

How do you implement user restriction correctly for Cloud functions?
Thanks for you help.

Answer: 
You are almost there:

```
for i in a:
    i.append(0)                         #want to add zero at the last of each sublist.
print(a)

```

The append modifies the existing list in the list, so no need to use the b variable
```
a = [ [0, 1 ,-1, 2, -2, 3, -3, 4, -4, -5, 5, 8], [0, 6 ,-6, 7, -7, 8, -8, 9, -9, -10, 10,  9] ]
x = list(map(lambda x: x + [0], a))
print(x)

```