

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to use enums in Python classes?
There is a module name "enum" in python with the hep of which enum is used in python.
#import enum import enum # use enum in class class Car(enum.Enum): suzuki = 1 Hyundai = 2 Dezire = 3 print ("All the enum values are : ") for c in (Car): print(c)
- Related Questions & Answers
- How to use enums in C++?
- How to use enums in C/C++?
- How to list all the classes, interfaces, and enums in JShell in Java 9?
- Java Program to use == operator to compare enums
- How to define classes in Python?
- How to use classes in other package in Java
- How to map C++ enums to strings?
- How do we use equivalence (“equality”) operator in Python classes?
- Enums in Rust Programing
- How do we use different CSS classes in HTML?
- Creating Classes in Python
- How data hiding works in Python Classes?
- Enumerated Types or Enums in C++
- Introduction to Classes and Inheritance in Python
- Data Classes in Python (dataclasses)
Advertisements