A. Innokentiev
A. Innokentiev

Reputation: 721

Why isalpha() doesn't work?

Python 3.4.3

I'm reading data from Excel-file via openpyxl. E18 cell contains text 'переход'.

from openpyxl import load_workbook

wb = load_workbook(filename='data.xlsx', read_only=True)
ws = wb.active
data = ws['E18'].value
print(data.isalpha())

Why it print False?

Upvotes: 1

Views: 959

Answers (1)

craigsparks
craigsparks

Reputation: 134

I created a similar spreadsheet with these values:

переход
'переход'
abc
'

It prints for each of the above respectively:

True
False
True
False

Does you data contain the ' character which is not alpha and therefor you get False?

print ("'".isalpha())
False
print ("переход".isalpha())
True
print ("'переход'".isalpha())
False

Upvotes: 1

Related Questions