mercredi 1 avril 2020

Program to check if alphabet is vowel or consonent

I am a beginner in python and trying to write a program to find if alphabet is vowel or consonant using list and for loop

The code is as follows:

    al=input("Enter the alphabet")

    list=['a','e','i','o','u']


    for p in list:
      if al==p:
          print("The alphabet is a vowel")


    else:
      print("The alphabet is a consonant")

The output is:

C:\Users\dell\PycharmProjects\HelloWorld\venv\Scripts\python.exe

C:/Users/dell/PycharmProjects/HelloWorld/app.py

Enter the alphabete

Process finished with exit code 0

Could someone tell me where i am going wrong

Aucun commentaire:

Enregistrer un commentaire