Python Tutorial Beginners: Python Sort Objects

preview_player
Показать описание
This is the next python tutorial for beginner to sort objects. I show how to sort a ist of numbers first and then I create a list of custom objects and demonstrate how to sort these by different attribute (name and id).

Table of contents:

00:00 Introduction
00:10 First sort a list of scalars (e.g. integers)
01:08 Create a simple custom Python object
02:10 Create a list of Python objects
03:13 Make a python class printable
04:10 Sort the list of Python objects
04:55 Import attrgetr for sorting by class attributes
06:15 Outro

The IDE I am using for my Python tutorials is PyCharm from JetBrains.

See my social profiles here
Рекомендации по теме
Комментарии
Автор

Excellent tutorials!
Actually Sorting Objects was quite helpful!
Keep the good work!

SyziphS
Автор

great tutorial! thanks saved me lot of time.

arturtomasz
Автор

How do I add in a list an array that is previously created? For example, let's say that I want to add your array "numbers" in the list Languages.

Reptobiz
Автор

These python lessons are so clear and well presented - a wonderful respite from lessons by American cowboys (who are also good people but a little hard on the ear)

timothybloxsome
Автор

This seems sorta similar to what I need. I've got a list of materials and i'd like to put it in a specific category based on if the name contains a certain keyword like steel, metal, gold etc for the metals category and come up with a naming convention or something so when I import all my materials they come into my addon into the right order/categories. Do you know of a way to sort material names based on keywords?

shredmancer