starting element

    0

    0

    Mahendra Kumar

    beginnerstrings

    Python to Check if Word Starts with Vowel or consonant

    # Python program to check if string starts with vowel
    # take inputs
    string = input('Enter any String: ')
    # vowel alphabet
    vowel = 'aeiou'
    # check string starts with vowel or consonant
    if string[0].lower() in vowel:
       print(string,'starts with vowel',string[0])
    else:
       print(string,'starts with consonant',string[0])
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.