Python program for pass statement

Python pass statement program: Here, we are demonstrating an example of pass statement in Python.
Submitted by IncludeHelp, on April 11, 2019

Prerequisite: pass statement in Python

In the below program, we have a string and printing only alphabets and passing the else statement – where the character in not an alphabet.

# python example of pass statement

string = "$IncludeHelp.Com$#@Hello"

# printing all alphabets only
for ch in string:
    if (ch>='A' and ch<='Z') || (ch>='a' and ch<='z'):
        print(ch)
    else:
        pass

print("End of the programs...")

Output

IncludeHelpComHello
End of the programs...

Python Basic Programs »



Related Programs



Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.