Python Program to Print Alphabets from A to Z

Python program to print all alphabets from a to z; In this tutorial, i will show you how to print all alphabets from a to z in python.

Python Program to Print Alphabets from A to Z

Now, i will write and show you some python program to print alphabets and from a to z and check whether a given input is alphabet or not; as shown below:

  • 1: Write a python program to print all alphabets from a to z using for loop
  • 2: Python program to print a to z in alphabets in lowercase using for loop
  • 3: write a program to check whether the given input is alphabet or not in python

1: Write a python program to print all alphabets from a to z using for loop

# write a python program to print alphabets in uppercase from a to z
 
print("Uppercase Alphabets are:")
for i in range(65,91): 
        ''' to print alphabets with seperation of space.''' 
        print(chr(i),end=' ') 

Output

Uppercase Alphabets are:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 

2: Python program to print a to z in alphabets in lowercase using for loop

# write a python program to print alphabets in lowercase from a to z
 
print("\nLowercase Alphabets are:")
for j in range(97,123): 
        print(chr(j),end=' ')

Output

Lowercase Alphabets are:
a b c d e f g h i j k l m n o p q r s t u v w x y z

3: write a program to check whether the given input is alphabet or not in python

# Python Program to Check Alphabet
ch = input("Enter a character: ")
if((ch>='a' and ch<= 'z') or (ch>='A' and ch<='Z')):
    print(ch, "is an Alphabet")
else:
    print(ch, "is not an Alphabet")

Output

Enter a character:  4
4 is not an Alphabet

Recommended Python Tutorials

Be First to Comment

Leave a Reply

Your email address will not be published.