can anyone please explain what is wrong with this code?
str1=\'\"xxx\"\' print str1 if str1[:1].startswith(\'\"\'): if str1[:-1].endswith(\'\"\'):
When you set a string variable, it doesn't save quotes of it, they are a part of its definition. so you don't need to use :1