Friday, December 27, 2024
Google search engine
HomeLanguagesPython Program to Print Alphabets from A to Z in Uppercase and...

Python Program to Print Alphabets from A to Z in Uppercase and Lowercase

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

  1. Python Program to Print ASCII Value of Character
  2. Write a Program to Calculate Simple Interest in Python
  3. Python Program to Compute Compound Interest
  4. Leap Year Program in Python
  5. Python Program to Print Star Pattern
  6. Number Pattern Programs in Python
  7. Python Program to Print Even and Odd numbers From 1 to N
  8. Python Abs() Function: For Absolute Value
  9. How to Check Whether a Number is Fibonacci or Not in Python
  10. Python: Program to Find Power of Number
  11. Python Program to Reverse a Numbers
  12. Python Program to Find Smallest/Minimum of n Numbers
  13. Python Program to Find Largest/Maximum of n Numbers
  14. Python Program to Find The Net Bill Amount After Discount
  15. Python Program to Print Numbers From N to 1 and 1 to N
  16. Python Program to Print Numbers Divisible by 3, 5, 7
  17. Python Program to Print Prime Number 1 to N
  18. How to Find Square of Number in Python
  19. Python Program to Calculate Cube of Number
  20. Python Program to Find LCM of Two Numbers
  21. BMI (Body Mass Index) Calculator in Python
  22. Palindrome Program in Python using while loop, Function, etc
  23. Python: Program to Count Total Number of Bits in Number
  24. Python Random Number Generator Code
  25. Python Program to Calculate n-th term of a Fibonacci Series
  26. Zip Zap Zoom Python Program
  27. Python: program to convert Celsius to Fahrenheit
  28. Python Program to Swap Two Numbers
  29. Python Program to Get Standard Deviation
  30. Python Program to Find the Variance
  31. Python Program to Convert Height in cm to Feet and Inches
  32. Python Program to Convert Meters into Yards, Yards into Meters
  33. Python Program to Convert Kilometers to Meters, Miles
  34. Python Program to Find Perfect Number
  35. Python: Program to Find Strong Number
  36. Python Program Create Basic Calculator
  37. Python Program For math.floor() Method
  38. Python Program to Find Sum of Series 1/1! 2/2! 3/3! …1/n!
  39. Python: Program to Convert Decimal to Binary, Octal and Hexadecimal
  40. Python Program to Find Roots of Quadratic Equation
  41. Python Check Binary Representation of Given Number is Palindrome or Not
  42. Python Program to Draw a Pie Chart
  43. Python Program Input the Radius of Circle and Compute the Area
  44. Python Program to Calculate the Area of a Rectangle
  45. Python Program to Calculate Area of Triangle
  46. Python Program to Find Area and Circumference of Circle using Radius
  47. Python Program that Accepts Marks in 5 Subjects and Outputs Average Marks
  48. Python Program to Print Binary Value of Numbers From 1 to N
RELATED ARTICLES

Most Popular

Recent Comments