Q:

Python program for pass statement

0

Python program for pass statement

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now