Home » Python » Python programs

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...





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL







Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.