friends = ["Mohamed", "Shady", "ahmed", "eman", "Sherif"]
ignoredNames = []
i = 0
while i < len(friends):
if friends[i].islower != True:
print(friends[i])
else:
ignoredNames.append(friends[i])
i += 1
print(f"The Number Of The Ignored Names Is {len(ignoredNames)}")
>Solution :
You need to call the method as .islower() rather than .islower. The former calls the method and actually returns the boolean value you want in the check.
For instance:
friends = ["Mohamed", "Shady", "ahmed", "eman", "Sherif"]
i=0
ignoredNames=[]
while i < len(friends):
if friends[i].islower() != True:
print(friends[i])
else:
ignoredNames.append(friends[i])
i += 1
print(ignoredNames)
Output:
Mohamed
Shady
Sherif
['ahmed', 'eman']