Movatterモバイル変換


[0]ホーム

URL:


Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only.Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Building Enumerations With Python's enum (Summary)

Now you have a solid understanding of how to create and utilizeenumerations in Python. Enumerations, also known asenums, are common data types in many programming languages. By using enums, you can organize related constants into groups and access them through the enumeration itself.

Although Python doesn’t have a specific syntax for enums, you can still create them by making use of theEnum class from theenum module.

In this video course, you’ve learned how to:

  • Create your ownenumerations using Python’sEnum class
  • Work with enums and theirmembers
  • Extend the capabilities of your enum classes by addingadditional functionalities
  • Apply enums in practical situations withreal-world examples

You’ve also gotten to know other valuable enumeration types, such asIntEnum,IntFlag, andFlag. These types are available in theenum module and enable you to create specialized enums.

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member?Sign-In

Locked learning resources

The full lesson is for members only.Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member?Sign-In

00:00Summary. Well done.You’ve made it to the end of the course.You now know how to create and use enumerations in Python.These are common and popular data types in manyprogramming languages.

00:13With enumerations, you can group sets of related constantsand access them through the enumeration itself.As you’ve seen, Python doesn’t provide a dedicated enumsyntax, but theenum module supports this common data typethrough theEnum class.

00:29In this course, you’ve learned howto create your own enumerations using Python’sEnum class,work with enumerationsand their members, provide your enumeration classeswith new functionalities,and use enumerations with some practical examples.

00:45You’ve also learned about other useful enumeration types,such asIntEnum,IntFlag, andFlag.They’re available inenumand will help you to create specialized enums.

00:58With all this knowledge, you are now readyto start using Python’s enums to group, name,and handle sets of semantically related constants.Enumerations allow you to better organize your code,making it more readable, explicit, and maintainable.

01:14We hope you found this course useful,and we’ll see you again soon at realpython.com.

Become a Member to join the conversation.

Course Contents

Overview
100%

[8]ページ先頭

©2009-2026 Movatter.jp