Python switch item

PHOTO EMBED

Tue Apr 04 2023 04:02:46 GMT+0000 (Coordinated Universal Time)

Saved by @tofufu #python

def operations(letter):
    switch={
       'a': "It is a vowel",
       'e': "It is a vowel",
       'i': "It is a vowel",
       'o': "It is a vowel",
       'u': "It is a vowel",
       }
    return switch.get(letter,"It is a not a vowel")		# disregard 2nd parameter

operations('a')
content_copyCOPY

https://pythongeeks.org/switch-in-python/