Python‎ > ‎string constants‎ > ‎

string.ascii_letters

http://www.adilwaseem.com/

Introduction
Return with the alphabets in upper and lower case.

Syntax
string.ascii_letters->alphabets in upper and lower case 

Parameters
None

Import module
Importing module is required in the Shell window and the Editor window.

Examples
The method is equivalent to:
>>> import string
>>> string.ascii_letters
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO
PQRSTUVWXYZ'

If statement is deployed to get the alphabets in lower and uppercase.
import string
search1=str(input("Type your search: "))
if search1=="alpalphabets" or "English letter" or "letters":
        print(string.ascii_letters)
>>>
Type your search: alphabets
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM
NOPQRSTUVWXYZ
>>>


Ouput

Comments