This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author MoKhaild
Recipients MoKhaild, ezio.melotti, mrabarnett
Date 2018-08-31.14:45:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1535726723.83.0.56676864532.issue34554@psf.upfronthosting.co.za>
In-reply-to
Content
match built-in function feature request:

what is the match function do?
the match function is doing something like if but with quick easy syntax that even beginners can use.

possible syntax:

match(list or string or dictionary):
  condition: event here
  condition: event here
#all conditions are applied at the same time as if not elif and else
#but you use elif or else.

ex:
match(list or string or dictionary):
  condition: event here
  condition: event here
    elif condition: event here
    else: event here
 

example of what I mean:
match([2,5,4,'Hello']):
  2: print('here is 2')
  6: print('here is 6')
    elif 'Hello': ('Hello world')
  8:print('here is 8')
    elif 'python': ('Hello world')
    else: print('MoKhalid')

the output should look like:
here is 2
Hello world
MoKhalid
History
Date User Action Args
2018-08-31 14:45:23MoKhaildsetrecipients: + MoKhaild, ezio.melotti, mrabarnett
2018-08-31 14:45:23MoKhaildsetmessageid: <1535726723.83.0.56676864532.issue34554@psf.upfronthosting.co.za>
2018-08-31 14:45:23MoKhaildlinkissue34554 messages
2018-08-31 14:45:23MoKhaildcreate