I know this is probably quite a simple problem but I am having an issue with the formatting of my function. I am getting a lot of 'unexpected indent' and also 'unexpected token'. I keep trying to format the function correctly but I have no idea why these errors keep on appearing. Here is my function:
def stringCheck(stringForCheck, letterOrNumber):
valid = True
x = 0
a = int(ord(stringForCheck)
length = len(stringForCheck)
if LetterOrNumber == 'Letter':
lowerBoundary = 65
upperBoundary = 90
elif LetterOrNumber == 'Number':
lowerBoundary = 48
upperBoundary = 57
while valid == True and x < length:
if a < lowerBoundary or a > upperBoundary:
valid = False
else:
valid = True
x = x + 1
stringCheck = valid
stringCheck('2','Number')
a = int(ord(stringForCheck)