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...")
In the below program, we have a string and printing only alphabets and passing the else statement – where the character in not an alphabet.
Output
need an explanation for this answer? contact us directly to get an explanation for this answer