i created this code in my vscode to run. But it was showing error so i thought the code might be wrong so i did many changes in it. But nothing worked. Then i interpreted the same code in my idle, BOOOM! it worked, i reinterpreted it many times and it worked fine. So i want to know why is it not working in vscode. Please help me!
def vowel(y,z):
if y in z:
print("It is a vowel")
else:
print("It is a consonant")
z=('a','e','i','o','u','A','E','I','O','U')
y=str(input("Enter a character= "))
vowel(y,z)
The error im getting in vscode
PS C:\Users\ANAND> python -u "c:\Users\ANAND\Desktop\python codes\vowel.py"
Enter a character= i
Traceback (most recent call last):
File "c:\Users\ANAND\Desktop\python codes\vowel.py", line 9, in <module>
y=str(input("Enter a character= "))
File "<string>", line 1, in <module>
NameError: name 'i' is not defined