From 7a13d856bc7fbbec8a13adbe9890135f044b14f0 Mon Sep 17 00:00:00 2001 From: anshuitzme <72157221+anshuitzme@users.noreply.github.com> Date: Fri, 1 Oct 2021 13:10:36 +0530 Subject: [PATCH] Create findEnum.py --- findEnum.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 findEnum.py diff --git a/findEnum.py b/findEnum.py new file mode 100644 index 0000000..ca2e1a8 --- /dev/null +++ b/findEnum.py @@ -0,0 +1,15 @@ +from enum import Enum + +class Day(Enum): + MONDAY = 1 + TUESDAY = 2 + WEDNESDAY = 3 + +# print the enum member +print(Day.MONDAY) + +# get the name of the enum member +print(Day.MONDAY.name) + +# get the value of the enum member +print(Day.MONDAY.value)