String - Special Characters

 Coding Problem Keys 

 String - Special Characters 

 Problem Statement 

The program must accept a string S as the input. The program must print the special characters in the string S as the output. A special character is a character that is not an alphabetic or numeric or space character.

Note: At least one special character is always present in the string S.

 Input Format 

The first line contains the string S.

 Output Format 

The first line contains the special characters in the string S.

 Boundary Condition(s) 

1 <= Length of S
 <= 100

 Example Input/Output 1 

 Input 

skill@rack#123

 Output 

@#

 Explanation 

The special characters in the string skill@rack#123 are @ and #.
Hence the output is @#

 Example Input/Output 2 

 Input 

Sum: 45 + 10 = 55

 Output 

:+=

 Max Execution Time Limit: 500 millisecs 

 Solution 

 Programming Language: Python 3 Language 

l=input().strip()
for i in l:
    if(i.isalnum()==False and i!=" "):
        print(i,end="")

# Published By PKJCODERS

 (Note: Incase If the code doesn't Pass the output kindly comment us with your feedback to help us improvise.) 

Comments

Popular Posts

Mango Distribution

Maximum Goods Transported

Value Equals Previous Two

RAT CHEESE MAZE

Alphabetical Order Pattern

Left Right Top Bottom Sum