check if special character in string python

Solutions on MaxInterview for check if special character in string python by the best coders in the world

showing results for - "check if special character in string python"
Ulysse
12 Mar 2018
1string = "Daneshwar$/?$Daneshwar"
2regex = re.compile('[@_!#$%^&*()<>?/\|}{~:]')
3if(regex.search(string) == None):
4	print("special is absent")
5else:
6	print("present")