Write a Python program that asks user to enter a character and check whether a character is an alphabet or not.

 TASK-

Write a Python program that asks user to enter a character and check whether a character is an alphabet or not.



CODE:


char=input("Enter the character: ")
if (char>='A' or char>='a')  and (char<='Z' or char<='z'):#check on character
    print("\n",char,"is a character")
else:
    print("\n",char,"is not an alphabet")

OUTPUT:

Enter the character: $

$ is not an alphabet


NEED WORK PRODUCE WORK

My name is Abdul Rehman I am from Pakistan. I am doing BS in Computer and information sciences. Currently, I am creating these blogs to help students of computer sciences all over the world..

2 Comments

  1. Such a good work keep trying and bringing new ideas
    Best of luck ☺️

    ReplyDelete
Post a Comment
Previous Post Next Post