what is wrong? import re tutorGroup = input(

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aadil29
    New Member
    • Sep 2019
    • 1

    what is wrong? import re tutorGroup = input(

    Code:
    import re
    tutorGroup = input("Enter you tutor group - e.g. 10MC: ")
    valid = re.match([0-9][0-9][A-Z][a-z], tutorGroup)
    if valid:
        print("OK!")
    else:
        print("Invalid!")
    Last edited by gits; Oct 1 '19, 08:11 AM. Reason: added code tags
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    not a python expert - but to me the issue seems to be that the pattern has to be passed to the match method as parameter of type string.

    Comment

    Working...