. Write a Python program that gets a single character from the user and writes out a congratulatory message if the character is a vowel (a, e, i, o, or u), but otherwise writes out a "You lose, better luck next time" message.

Respuesta :

Answer:

# import statements

import sys

# main method

def main():  

   # Prompt the user to enter a character

   print('Enter a character: ')

   # Read a character from console

   chr = sys.stdin.read(1)

 

   # Check wether the character is vowel or not

   if chr in ['a','e','i','o','u']:

       print('congratulations!')  

   else:

       print('You lose, better luck next time')

     

# Call main method

main()

Explanation: