Python program to print all alphabets from a to z in uppercase and lowercase; In this python article, we would love to share with you how to print alphabets from a to z in uppercase and lowercase in the python using loop.
Before we create programs in python to display alphabets in python, we must know about ASCII.
What is ASCII?
ASCII stands for the American Standards Code for Information exchange. It provides us the numerical value for the representation of characters. The ASCII value of uppercase letters and lowercase alphabets start from 65 to 90 and 97-122 respectively.
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
In the above python program, you have learned how to print alphabets from a to z in uppercase and lowercase.
Now you will learn another python program, which is used to check entered value is an alphabet or not.
3: Python Program to Check Alphabet
- Take input from user.
- Store an input value in the variable.
- Check enter value is alphabet or not
- Print result.
# 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 Programs
- Python Program to Print ASCII Value of Character
- Write a Program to Calculate Simple Interest in Python
- Python Program to Compute Compound Interest
- Leap Year Program in Python
- Python Program to Print Star Pattern
- Number Pattern Programs in Python
- Python Program to Print Even and Odd numbers From 1 to N
- Python Abs() Function: For Absolute Value
- How to Check Whether a Number is Fibonacci or Not in Python
- Python: Program to Find Power of Number
- Python Program to Reverse a Numbers
- Python Program to Find Smallest/Minimum of n Numbers
- Python Program to Find Largest/Maximum of n Numbers
- Python Program to Find The Net Bill Amount After Discount
- Python Program to Print Numbers From N to 1 and 1 to N
- Python Program to Print Numbers Divisible by 3, 5, 7
- Python Program to Print Prime Number 1 to N
- How to Find Square of Number in Python
- Python Program to Calculate Cube of Number
- Python Program to Find LCM of Two Numbers
- BMI (Body Mass Index) Calculator in Python
- Palindrome Program in Python using while loop, Function, etc
- Python: Program to Count Total Number of Bits in Number
- Python Random Number Generator Code
- Python Program to Calculate n-th term of a Fibonacci Series
- Zip Zap Zoom Python Program
- Python: program to convert Celsius to Fahrenheit
- Python Program to Swap Two Numbers
- Python Program to Get Standard Deviation
- Python Program to Find the Variance
- Python Program to Convert Height in cm to Feet and Inches
- Python Program to Convert Meters into Yards, Yards into Meters
- Python Program to Convert Kilometers to Meters, Miles
- Python Program to Find Perfect Number
- Python: Program to Find Strong Number
- Python Program Create Basic Calculator
- Python Program For math.floor() Method
- Python Program to Find Sum of Series 1/1! 2/2! 3/3! …1/n!
- Python: Program to Convert Decimal to Binary, Octal and Hexadecimal
- Python Program to Find Roots of Quadratic Equation
- Python Check Binary Representation of Given Number is Palindrome or Not
- Python Program to Draw a Pie Chart
- Python Program Input the Radius of Circle and Compute the Area
- Python Program to Calculate the Area of a Rectangle
- Python Program to Calculate Area of Triangle
- Python Program to Find Area and Circumference of Circle using Radius
- Python Program that Accepts Marks in 5 Subjects and Outputs Average Marks
- Python Program to Print Binary Value of Numbers From 1 to N