jeudi 27 août 2020

error syntax on if nesting(intermediate-advance) [closed]

import re,sys
a = input('?\n')
b = re.search('[A-Z]+',a)

if b is not None:
   if len(b.group()) == len(a):
       print('@')
       sys.exit()#if b is not None:
   
 #Thank you
 #what above code should do
#if b is not None:
    #if len(b.group()) == len(a):
        #print('@')
        #sys.exit()

** If b is not None is True,I want to group and compare its length to a to determine if the whole of a is uppercase or not**

Aucun commentaire:

Enregistrer un commentaire