PY Verify Case

Source: Internet
Author: User

# CODING:GBK

Import Random

Import string

Import re

Def numx ():

While 1:

#t =re.compile (R ' [A-z0-9a-z] ')

N= '. Join (Random.sample (string.letters+string.digits,4)). Strip ('/n '). Replace (', ', ', ')

Print n

Xp=re.compile (' \w+ ', re. I)

Rxp=xp.findall (n) [0].upper ()

#t1 =t.match (N)

#print N.strip ('-')

#n. Split ("[', ']")

Num1=raw_input (' please input and corresponding verification above:')

print ' num1=%s, rxp=%s '% (Num1.upper (), RXP)

#if num1.upper () in RXP or Num1.lower () in RXP:

If num1.upper () = = RxP:

print ' verification code correct '

print ' case insensitive '

Break

Else

print ' verification code is incorrect '

print ' case insensitive '

Continue

NUMX ()

PY Verify Case

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.