My issue
I’m a bit confused about the substring that needs to be extracted, I had stored it in A. But I think the m value is not updated after the loop. Please help
My code
# Update the code below to solve the problem
t = int(input())
for i in range(t):
S = input()
count=0
flag=0
A=''
for i in S:
m=0
A=A+i[m:m+2]
for j in A:
if(j==('a' or 'e' or 'i' or 'o' or 'u')):
count+=1
else:
flag=1
m=m+1
if(count>2 and flag==0):
print("Happy")
elif(count<2 and flag==1):
print("Sad")
Learning course: Python for problem solving - 2
Problem Link: CodeChef: Practical coding for everyone