# Sort function not worknig

**URL:** <https://discourse.jupyter.org/t/sort-function-not-worknig/10108>\
**Category:** Notebook\
**Created:** [July 25, 2021, 3:11pm UTC](https://discourse.jupyter.org/t/sort-function-not-worknig/10108 "2021-07-25T15:11:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Maxwell](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/paul_maxwell/32/4859_2.png) [@Paul\_Maxwell](https://discourse.jupyter.org/u/Paul_Maxwell)\
**Post date:** [July 25, 2021, 3:11pm UTC](https://discourse.jupyter.org/t/sort-function-not-worknig/10108/1 "2021-07-25T15:11:06Z")

</div>

Hi i am still very new to Jupyter notebook. i do hope someone can help me?  
when i create a list list=(200,60,7,190,89,3,20,0) but when i use the sort function list.sort() juypter notebook says thsort ahs no attribute

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [July 25, 2021, 3:51pm UTC](https://discourse.jupyter.org/t/sort-function-not-worknig/10108/2 "2021-07-25T15:51:46Z")

</div>

Hi @Paul_Maxwell, welcome to Jupyter 🎉. Jupyter is a project enabling interactive computing using a variety of languages (including Julia, Python, R, and many others); you did not specify the language you are using and it might be difficult for volunteers like me to help you without knowing it. You would normally know what language you are using, but if you are using a Jupyter notebook on a platform provided by someone else (e.g. University) you can easily check it by looking at the right-top corner. I highlighted in blue how it looks like in JupyterLab:

 ![Screenshot from 2021-07-25 16-38-30](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/2/202be00950b6fdb4b49fdaa2d06f446ef30298e5.png)

And in Jupyter Notebook:

 ![Screenshot from 2021-07-25 16-37-59](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/f/f7bc123da27690b5437e905d03b0d7d6ffb93bd2.png)

I am going to take a bet and assume that you are using Python; in that case a likely reason would be the use of the round parentheses `(` and `)` instead of square brackets `[` and `]` as the former defines a `tuple`, while the latter defines a `list`. In Python tuples and lists are similar, but while lists can be changed (e.g. can be extended with an extra element, or rearranged), tuples always stay the same after creation (are _immutable_). This is why there is `list.sort` but no `tuple.sort`.

The good news is that having a Python variable you can always check its type yourself, for example:

```python
object_from_question = (200, 60, 7, 190, 89, 3, 20, 0)
type(object_from_question)

```

Will return:

> `tuple`

while:

```python
my_list = [200, 60, 7, 190, 89, 3, 20, 0]
type(my_list)

```

Will give you:

> `list`

And just to show that sorting works well on lists:

```python
my_list.sort()
my_list

```

> `[0, 3, 7, 20, 60, 89, 190, 200]`

Also here is the same as a screenshot:

 ![Screenshot from 2021-07-25 16-47-00](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/1/1e625b551607bb2b92e5047ed0dc24ae4942db78.png)

If you are new to programming with Python you can safely assume that in 99% of cases the issue will be related to the programming language rather than to the Jupyter interface. It is just an intermediary between you and the language of your choice, and usually a good one :).

---

<div class="post-metadata">

**Author:** ![Paul\_Maxwell](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/paul_maxwell/32/4859_2.png) [@Paul\_Maxwell](https://discourse.jupyter.org/u/Paul_Maxwell)\
**Post date:** [July 25, 2021, 8:53pm UTC](https://discourse.jupyter.org/t/sort-function-not-worknig/10108/3 "2021-07-25T20:53:24Z")

</div>

Hi T [krassowski thank you i will try that… once again thank you

---

<div class="post-metadata">

**Author:** ![Paul\_Maxwell](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/paul_maxwell/32/4859_2.png) [@Paul\_Maxwell](https://discourse.jupyter.org/u/Paul_Maxwell)\
**Post date:** [July 26, 2021, 8:10am UTC](https://discourse.jupyter.org/t/sort-function-not-worknig/10108/4 "2021-07-26T08:10:15Z")

</div>

Thank you very much for your reply. could you point me to a useful learning site for Python using the Huypter notebook. i must still be doing something wrong the sort function works sometimes and sometimes i get \*\*(_**has no objector has no attribute)**. any help would be very much_

---

<div class="post-metadata">

**Author:** ![Paul\_Maxwell](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/paul_maxwell/32/4859_2.png) [@Paul\_Maxwell](https://discourse.jupyter.org/u/Paul_Maxwell)\
**Post date:** [July 26, 2021, 8:15am UTC](https://discourse.jupyter.org/t/sort-function-not-worknig/10108/5 "2021-07-26T08:15:24Z")

</div>

using the sort function i am getting this reply **_\*the object needs an argument_**  
**_cheers for now Paul_**

---

<div class="post-metadata">

**Author:** ![itsdebartha](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/itsdebartha/32/4849_2.png) [@itsdebartha](https://discourse.jupyter.org/u/itsdebartha)\
**Post date:** [July 26, 2021, 1:00pm UTC](https://discourse.jupyter.org/t/sort-function-not-worknig/10108/6 "2021-07-26T13:00:24Z")

</div>

There are a lot of many good resources to learn python on the internet. I suggest you read some articles like [this](https://stackoverflow.blog/2021/07/14/getting-started-with-python/) and find out what suits you best learning the language. As a start, read some books (like the one written by John Zelle, which I read at first). Here’s another [link](https://stackoverflow.com/tags/python/info) which can help you to find what you need (scroll down to the part of ‘Free Python Programming Books’ and from then onwards but I suggest you read the whole information page). One more [link](https://stackoverflow.com/q/34570/8484779) to help you get started. But the real task lies with you: You have to find out which one suits you best. 😉
